dealpos 26.41.55 → 26.41.56
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-KCJVC3D5.js → chunk-27AAXJEZ.js} +2 -2
- package/browser/{chunk-HKUNDXSX.js → chunk-2BXHTKJH.js} +1 -1
- package/browser/{chunk-HAUJALUH.js → chunk-2UZOSMPU.js} +1 -1
- package/browser/{chunk-ZABYOGLE.js → chunk-3X4LLCCP.js} +1 -1
- package/browser/{chunk-A7JI4ZNX.js → chunk-46RN2EXE.js} +1 -1
- package/browser/{chunk-6NUSKD4W.js → chunk-4DOUGETW.js} +1 -1
- package/browser/{chunk-EDCHHISW.js → chunk-4XAUOTMC.js} +1 -1
- package/browser/{chunk-ZBZPU43T.js → chunk-5IH2IOBL.js} +1 -1
- package/browser/{chunk-P6AGIAP3.js → chunk-5IN3SXME.js} +1 -1
- package/browser/{chunk-WKPO4QSK.js → chunk-5U6KKKXF.js} +1 -1
- package/browser/{chunk-YMDZSFDP.js → chunk-5WGVHMJO.js} +1 -1
- package/browser/{chunk-CWKMKHTW.js → chunk-5XSCMT3F.js} +1 -1
- package/browser/{chunk-JQANKZU4.js → chunk-6IT2AIQO.js} +1 -1
- package/browser/{chunk-KITYD675.js → chunk-74WJQD6C.js} +1 -1
- package/browser/{chunk-QYT2JOXO.js → chunk-7BX77VAJ.js} +1 -1
- package/browser/{chunk-K74YTBJC.js → chunk-7FDOD3T4.js} +1 -1
- package/browser/{chunk-R57CTLTT.js → chunk-7KTSOXKS.js} +1 -1
- package/browser/{chunk-J3YTG6E4.js → chunk-7XB6RA7V.js} +1 -1
- package/browser/{chunk-NFOVMPUD.js → chunk-AB35TLNF.js} +1 -1
- package/browser/{chunk-7RNBTDCT.js → chunk-AELFCPAZ.js} +1 -1
- package/browser/{chunk-33ND5WEY.js → chunk-AIQCVDBX.js} +1 -1
- package/browser/{chunk-SHII5XVO.js → chunk-AUUEG4PA.js} +1 -1
- package/browser/{chunk-X62J3DRC.js → chunk-AWENDKAA.js} +1 -1
- package/browser/{chunk-3ZJ27K2D.js → chunk-AZZZOSB5.js} +2 -2
- package/browser/{chunk-XOVEXBVU.js → chunk-B7OF6JMI.js} +1 -1
- package/browser/{chunk-YRRDPMB5.js → chunk-BOUAAC7W.js} +2 -2
- package/browser/{chunk-UYDHYMN4.js → chunk-CCYEPMDV.js} +1 -1
- package/browser/{chunk-J6TYUZI2.js → chunk-CKMZBOZL.js} +1 -1
- package/browser/{chunk-B6VOPOAY.js → chunk-D4BEJ6ZS.js} +1 -1
- package/browser/{chunk-2Q4GLDGS.js → chunk-D7TIRKQD.js} +1 -1
- package/browser/{chunk-UVDJ5F2Z.js → chunk-EARST2OD.js} +1 -1
- package/browser/{chunk-L2TXH3DT.js → chunk-EE3YE455.js} +1 -1
- package/browser/{chunk-KVKHMMBC.js → chunk-EKWBRXL5.js} +1 -1
- package/browser/{chunk-AXZDSJ24.js → chunk-EMHLHCRC.js} +1 -1
- package/browser/{chunk-IAVU4SKC.js → chunk-EZHA56VR.js} +1 -1
- package/browser/{chunk-FGRELDIA.js → chunk-FASCCLKK.js} +2 -2
- package/browser/{chunk-JLIKALCO.js → chunk-FRWRRL3X.js} +1 -1
- package/browser/{chunk-BRA2UNTJ.js → chunk-FY3BKKSK.js} +1 -1
- package/browser/{chunk-TQ7AZFR3.js → chunk-GLIID4DH.js} +1 -1
- package/browser/{chunk-NXDWKAEV.js → chunk-GWO2ESFY.js} +1 -1
- package/browser/{chunk-WKNAKOKJ.js → chunk-GZI4RO2N.js} +1 -1
- package/browser/{chunk-WAEZXIYL.js → chunk-HVE4FT5Q.js} +1 -1
- package/browser/chunk-I365SIMI.js +1 -0
- package/browser/{chunk-KZ37J3EZ.js → chunk-I4OBGKU4.js} +1 -1
- package/browser/{chunk-FWKZZ2N3.js → chunk-I64NISZR.js} +1 -1
- package/browser/{chunk-SGYF5WYT.js → chunk-IDADE5OT.js} +1 -1
- package/browser/{chunk-CVMI3STJ.js → chunk-IIHJIJVU.js} +1 -1
- package/browser/{chunk-4WZM4HL7.js → chunk-IV6JWQIC.js} +1 -1
- package/browser/{chunk-35EQD7TC.js → chunk-K7V7ZXUO.js} +1 -1
- package/browser/{chunk-YPOHGC3M.js → chunk-KMESGBCF.js} +1 -1
- package/browser/{chunk-C2KVMAJD.js → chunk-KQCS7D3I.js} +1 -1
- package/browser/{chunk-NAVXGISQ.js → chunk-LAR7UELS.js} +1 -1
- package/browser/{chunk-OA4VJON6.js → chunk-LC3RRJUZ.js} +1 -1
- package/browser/{chunk-UACTAF6U.js → chunk-LIHDRST2.js} +1 -1
- package/browser/{chunk-A545JKVS.js → chunk-LKILXWEX.js} +2 -2
- package/browser/{chunk-NVKXGDVR.js → chunk-MFXSSIWX.js} +1 -1
- package/browser/{chunk-KZMSNJKV.js → chunk-MHS3XFLI.js} +1 -1
- package/browser/{chunk-Z3MKVNFF.js → chunk-MSWXD5AK.js} +1 -1
- package/browser/{chunk-C4VZ5IZY.js → chunk-N4XHJ2BK.js} +1 -1
- package/browser/{chunk-OVCOB7WF.js → chunk-NIEJUTEO.js} +1 -1
- package/browser/{chunk-5QXJNVOO.js → chunk-NK7E7UJL.js} +1 -1
- package/browser/{chunk-G5X3CYV3.js → chunk-OKQUTA7Q.js} +1 -1
- package/browser/{chunk-PECFN37U.js → chunk-OKWYG2K5.js} +1 -1
- package/browser/{chunk-VEA6DVQO.js → chunk-OLK4BSJ7.js} +1 -1
- package/browser/{chunk-7FESPKVR.js → chunk-ONP3DCYC.js} +1 -1
- package/browser/{chunk-VIOICYUV.js → chunk-ONQO2I6F.js} +1 -1
- package/browser/{chunk-UOUKOBPM.js → chunk-OZY277ZB.js} +1 -1
- package/browser/{chunk-XJAZQYNU.js → chunk-P42BZLB7.js} +1 -1
- package/browser/{chunk-6XFT2ASF.js → chunk-PGV7CR57.js} +1 -1
- package/browser/{chunk-QU33TWHO.js → chunk-Q2TR6T4X.js} +1 -1
- package/browser/{chunk-2UAYPPKG.js → chunk-QMEJN4V4.js} +1 -1
- package/browser/{chunk-A4BMJGVW.js → chunk-QND4M3CU.js} +1 -1
- package/browser/{chunk-HTENL6PI.js → chunk-QUEKIX5A.js} +1 -1
- package/browser/{chunk-Z4N6SXNM.js → chunk-R3LVKGET.js} +2 -2
- package/browser/{chunk-TLXACGP4.js → chunk-R5D3HG62.js} +2 -2
- package/browser/{chunk-EOIM6MY3.js → chunk-R7LJKE6Y.js} +1 -1
- package/browser/chunk-RDGMLBYX.js +1 -0
- package/browser/{chunk-SUBQISHT.js → chunk-RDR5QRH2.js} +1 -1
- package/browser/{chunk-BJRJRUDK.js → chunk-S5BNZ74P.js} +1 -1
- package/browser/{chunk-LIZVLB4Y.js → chunk-S7D4YVIZ.js} +1 -1
- package/browser/{chunk-RV5OQ2HP.js → chunk-SBDHBCD4.js} +1 -1
- package/browser/{chunk-TGUUERBV.js → chunk-TM5ZKKQ7.js} +1 -1
- package/browser/{chunk-W4GUAUTS.js → chunk-TRJZVPIS.js} +1 -1
- package/browser/{chunk-Z4EU7CTC.js → chunk-TTRF5UU5.js} +1 -1
- package/browser/{chunk-FJFLSQIS.js → chunk-U47ASQEC.js} +1 -1
- package/browser/{chunk-DHUEVFI5.js → chunk-UFA7KPAL.js} +1 -1
- package/browser/{chunk-JV6UMRYY.js → chunk-UGVVNBJB.js} +1 -1
- package/browser/{chunk-RYP2DILM.js → chunk-UNQQDJKB.js} +1 -1
- package/browser/{chunk-3RYEX7Y3.js → chunk-UR5AAM2B.js} +1 -1
- package/browser/{chunk-WWGDNSFH.js → chunk-V2KFOI5O.js} +1 -1
- package/browser/chunk-VFCL2DS3.js +1 -0
- package/browser/{chunk-4DJ5OAOA.js → chunk-VSNEONQ7.js} +1 -1
- package/browser/{chunk-AOPOAWJB.js → chunk-W5OI7ST2.js} +1 -1
- package/browser/{chunk-2D22WHPR.js → chunk-X6RJ6QF7.js} +1 -1
- package/browser/{chunk-EMWZWX45.js → chunk-XSYDKAYT.js} +2 -2
- package/browser/{chunk-55XZ33UY.js → chunk-YASD3VTU.js} +1 -1
- package/browser/{chunk-SJNTFNWD.js → chunk-YBESMONY.js} +1 -1
- package/browser/{chunk-4XDQ3MSJ.js → chunk-Z5HEZN3T.js} +1 -1
- package/browser/{chunk-QL6A3QH7.js → chunk-ZCEDZS5C.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-KDKXA5MF.js → main-N6JCXE66.js} +1 -1
- package/browser/ngsw-config.json +1 -1
- package/browser/ngsw.json +501 -501
- package/package.json +1 -1
- package/browser/chunk-C2SRHPWG.js +0 -1
- package/browser/chunk-D4WX4UWT.js +0 -1
- package/browser/chunk-U6BHZUDV.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Dd}from"./chunk-A6SE3QXT.js";import{a as wg}from"./chunk-W6CIVNQM.js";import{a as bg}from"./chunk-J5SPES4K.js";import"./chunk-JYFQIEYE.js";import{a as yd,b as Ac,d as Sc}from"./chunk-EMWZWX45.js";import{a as cg}from"./chunk-4YGA4HTH.js";import{a as Id}from"./chunk-GUQERFKT.js";import{a as kc}from"./chunk-UQNLKJVP.js";import"./chunk-SAK6KLMJ.js";import{a as wc,b as hg,c as xg,d as _g,e as Cg,f as yg}from"./chunk-WFO4AMBS.js";import{a as Cd}from"./chunk-33G5WPLU.js";import{a as pg}from"./chunk-FFEJKFVT.js";import{a as dg,b as kd}from"./chunk-AVVWNWQB.js";import{a as _d,b as tf,c as nf,e as Ag}from"./chunk-7FESPKVR.js";import"./chunk-C2SRHPWG.js";import{a as Ml}from"./chunk-SUBQISHT.js";import{a as Ad}from"./chunk-2Y6XEGSQ.js";import{b as mg,c as fg,d as ug,e as vg,f as gg,g as Sd}from"./chunk-QIGTN3VT.js";import{a as il}from"./chunk-4OPSGGJV.js";import{a as wd}from"./chunk-2J5N4H5L.js";import{a as Ic}from"./chunk-X3EZKNFB.js";import{a as e1}from"./chunk-5IB4NAOH.js";import"./chunk-33ND5WEY.js";import{a as sg}from"./chunk-Q3ZNI7UU.js";import{a as Gv}from"./chunk-G46E6JZA.js";import"./chunk-XAJYJKZY.js";import{a as Yv}from"./chunk-NAVXGISQ.js";import{a as _c}from"./chunk-BBMCHQFM.js";import{a as vs}from"./chunk-WPC3FVPP.js";import{b as dd}from"./chunk-3UI7UC5E.js";import{a as B2}from"./chunk-2FC7VAOT.js";import{a as uc,b as H2}from"./chunk-NOXFZLVJ.js";import"./chunk-BJCHUBGO.js";import"./chunk-NNEANRX6.js";import{a as md}from"./chunk-I7ECOHHK.js";import{a as zv,b as cd}from"./chunk-F4W3MUBR.js";import{a as tl}from"./chunk-BPMDDE4D.js";import{a as fs}from"./chunk-CWKMKHTW.js";import{a as bd}from"./chunk-JG5N5RZJ.js";import{b as xd}from"./chunk-QP4KTVAU.js";import{b as ig,c as ng,e as ag,f as rg,g as hd}from"./chunk-FYCVHWE5.js";import{a as tg}from"./chunk-2E5HYZMR.js";import{a as og}from"./chunk-VLKLGJDL.js";import{a as lg}from"./chunk-P3KIIKY4.js";import"./chunk-AO63R3DI.js";import{b as vd}from"./chunk-ZPIILEA6.js";import{b as yc}from"./chunk-7HMU6MXA.js";import{a as Cc}from"./chunk-GWNGKIUL.js";import{a as gd}from"./chunk-2LD4VKHV.js";import{a as Dl}from"./chunk-OTOJ3MGJ.js";import"./chunk-BYXBJQAS.js";import{a as g1}from"./chunk-DDLXGCOB.js";import{a as ud}from"./chunk-52BMY5DH.js";import{a as Xv,c as $v,e as Zv,f as eg,g as fd}from"./chunk-53CYOKMD.js";import{a as kl}from"./chunk-QIUN3PYQ.js";import{a as Pv,b as U2,c as Q2,d as j2,e as L2}from"./chunk-MBSYHKPE.js";import"./chunk-PT6PCXOU.js";import{a as xc}from"./chunk-KIAB6W7M.js";import{a as Wv,e as Jv,f as Kv,g as pd}from"./chunk-ER2NCDJO.js";import{b as Kr}from"./chunk-P2NWTCME.js";import{a as gc}from"./chunk-BJRJRUDK.js";import{a as J2}from"./chunk-3XYL5JLY.js";import{c as q2}from"./chunk-F76MWCWQ.js";import"./chunk-XX7AIWP2.js";import{a as ld}from"./chunk-RCLIXTOJ.js";import{l as N2,m as Ax,p as Xr}from"./chunk-SCH7M36Q.js";import{d as V2}from"./chunk-7TQOVQ3O.js";import{c as O2}from"./chunk-G53IMHKY.js";import"./chunk-3EAA4CUP.js";import"./chunk-5U2B2SGN.js";import"./chunk-YJV74F2X.js";import"./chunk-WPCHBRKW.js";import{a as us,b as sd}from"./chunk-WUR7UGG2.js";import{b as k1}from"./chunk-C6AVODTR.js";import"./chunk-IIJLLEMO.js";import{a as id,c as nd}from"./chunk-GMYHR4TH.js";import{b as S1,c as I1,d as fc}from"./chunk-ANFR3NR4.js";import"./chunk-PZSSTNYS.js";import{d as ad}from"./chunk-YHZEJWGM.js";import{a as Zo}from"./chunk-WHKDTNK2.js";import{c as od}from"./chunk-WM2CE23W.js";import"./chunk-VFRVMDDY.js";import"./chunk-ESZD2F4X.js";import{a as Sl}from"./chunk-RV5OQ2HP.js";import"./chunk-55XZ33UY.js";import{a as vc}from"./chunk-ONECCHQ5.js";import"./chunk-ROZU3QVN.js";import{b as td}from"./chunk-GKGUNK27.js";import{a as Z1}from"./chunk-XISCWQFV.js";import{c as Z2,d as qv,e as ed,f as tn,g as hc}from"./chunk-UOUKOBPM.js";import{a as Ev,b as Tv,c as R2,d as Co}from"./chunk-M43FFEY2.js";import"./chunk-5VC2XYC5.js";import"./chunk-WRBKQHRI.js";import"./chunk-FS62MIXD.js";import{a as _o}from"./chunk-G56UPMKR.js";import"./chunk-BAIS4TWD.js";import"./chunk-XBINTEVI.js";import{a as G2,d as Bv,e as Nv,f as Fv,h as z2}from"./chunk-LN7LGRLI.js";import"./chunk-EP7SKSJT.js";import"./chunk-LAQZXTBX.js";import{c as rd}from"./chunk-QSFZAHQ2.js";import"./chunk-TGQEO6S3.js";import"./chunk-ONKLHHM3.js";import"./chunk-X2OQT5MH.js";import"./chunk-XTOFMSDQ.js";import"./chunk-ZM456L6A.js";import"./chunk-F5JDPCBG.js";import"./chunk-X62J3DRC.js";import{a as en}from"./chunk-NFOVMPUD.js";import"./chunk-3DC26I3D.js";import{a as X2,b as $2}from"./chunk-UHM2XEMM.js";import{c as Il,d as K2}from"./chunk-UQSKGZO5.js";import{c as Dv,g as Mv,n as F2}from"./chunk-4BITXMRY.js";import"./chunk-2AOZZW2I.js";import"./chunk-TM2I5PAG.js";import{a as Ei,b as nr}from"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import{B as Qv,F as jv,G as Lv,N as Hv,O as bc,g as el,h as Vv,m as Rv,o as Ov,r as Uv}from"./chunk-UI32X6QC.js";import"./chunk-OVCNCVGF.js";import{a as Y2,b as W2,d as $o}from"./chunk-BUIP3UCE.js";import"./chunk-PWMMCY25.js";import"./chunk-OKQYRKDJ.js";import"./chunk-SIAVPMSP.js";import{b as T2}from"./chunk-N5VS2V7L.js";import{a as X1,b as $1,c as Ma}from"./chunk-3V6FZIJD.js";import"./chunk-DEJ5V3PF.js";import"./chunk-T45W4CQR.js";import"./chunk-OK7LFGGQ.js";import"./chunk-VGLTFO5N.js";import"./chunk-UTSVZMZD.js";import{a as pc}from"./chunk-BP6PECKT.js";import{a as Da}from"./chunk-GNDUQZGK.js";import"./chunk-7KKUTTZ3.js";import"./chunk-ZS4XLRDB.js";import"./chunk-TYEI4SD2.js";import{a as Zi,b as K1,c as Xo}from"./chunk-BKOMMH62.js";import"./chunk-7ESJNFN4.js";import"./chunk-JTDKDDTJ.js";import"./chunk-3TKWEWIY.js";import{ra as Iv,ua as kv}from"./chunk-SXVOKLC4.js";import{A as Al,C as Sv,F as mc,G as P2,b as A1,c as Cn,e as ef,h as Vi,i as _v,l as Cv,m as r0,p as Ri,q as yv,r as wv,t as Av}from"./chunk-AJDQZ346.js";import"./chunk-W4GUAUTS.js";import"./chunk-SJNTFNWD.js";import"./chunk-YY6WVNU4.js";import{b as yi}from"./chunk-PUBGTLD3.js";import{a as Qi,b as xv}from"./chunk-PPTZHIIZ.js";import{a as E2}from"./chunk-WKPO4QSK.js";import{n as zi,q as ki}from"./chunk-QGYXJUX3.js";import{$a as se,$c as k2,Ab as vi,Ba as Qe,Bb as Jt,Cb as Kt,Da as rc,Db as M,E as ql,Ea as Wr,Eb as d,Fb as p,Fc as F,Ga as oc,Gb as G,Gc as Ce,Hc as Ie,Hd as bv,I as C2,Ic as S2,Id as hv,Jc as mv,Kb as zl,L as iv,Lb as Yl,Lc as co,Ld as dc,Na as W1,Oc as H1,P as nv,Pa as vl,Pb as Se,Pc as fv,Pd as Jn,R as av,Rd as ir,Sb as de,Sc as I2,Sd as li,Tc as Ci,Ua as f,Ub as x,Uc as uv,Ud as v1,Va as ov,Y as xo,Yb as ms,Yc as y1,Zb as Wl,_a as w2,_b as Jl,aa as Gl,ac as sv,bc as cv,cc as wa,db as nt,dc as Kl,e as ps,ea as C1,eb as lc,ec as hr,fb as A2,fc as Os,gc as Jo,hc as v,hd as vv,ib as $i,ic as Ae,jb as _i,jc as oe,kc as so,kd as Jr,l as a0,la as ac,lc as dv,m as tv,mc as Le,md as D2,nc as Oe,nd as cc,oa as dn,oc as je,od as M2,pc as Us,qc as sc,qd as w1,ra as U,rc as Qs,s as u1,sa as Q,sb as lv,sc as pv,sd as Vn,td as gv,ud as Li,wb as k,xc as ft,xd as tr,ya as y2,yb as D,yc as ot,za as rv,zb as J1,zc as Ko}from"./chunk-7D344CRC.js";import{a as kr,b as Fo,g as wx,j as nc}from"./chunk-NF7PG5F2.js";function Sx(o,c){o&1&&(d(0,"span",6),v(1,"Main"),p())}function Ix(o,c){if(o&1){let a=Se();d(0,"button",8),de("click",function(){U(a);let s=x().$index,m=x();return Q(m.onRemove(s))}),v(1," \xD7 "),p()}}function kx(o,c){if(o&1){let a=Se();d(0,"div",3),de("cdkDropListDropped",function(s){U(a);let m=x();return Q(m.drop(s))}),d(1,"div",4),de("click",function(s){let m=U(a).$implicit,h=x();return Q(h.onZoomImage(m.OnNewFormURL??m.URL,s))}),G(2,"img",5),k(3,Sx,2,0,"span",6),k(4,Ix,2,0,"button",7),p()()}if(o&2){let a=c.$implicit,l=c.$index,s=x();M("cdkDropListData",l),f(2),M("src",a.ImageURL||a.ImageUrl||"",vl)("alt",a.ImageName||"Product image"),f(),D(l===0?3:-1),f(),D(s.hasRole()?4:-1)}}function Dx(o,c){o&1&&(d(0,"div",10),G(1,"i",12),d(2,"div",13),v(3,"Upload Image"),p()())}function Mx(o,c){o&1&&G(0,"i",11)}function Ex(o,c){if(o&1){let a=Se();d(0,"div",9),de("click",function(){U(a);let s=x();return Q(s.openUploadDialog())}),k(1,Dx,4,0,"div",10)(2,Mx,1,0,"i",11),p()}if(o&2){let a=x();hr("piu-upload-area--full",a.images().length===0)("piu-upload-area--shrink",a.images().length>0)("piu-upload-area--disabled",!a.hasRole()),M("matTooltip",a.hasRole()?"Click to upload image":"You do not have permission to upload images"),f(),D(a.images().length===0?1:2)}}var gs=class o{role=dn(yi);dialog=dn(Ma);bigPicture=dn(vs);images=Ci([]);maxFile=Ci(5);cloudinaryFolder=Ci("");productID=Ci(null);imagesChange=I2();hasRole=H1(()=>this.role.product?.ImageEditor);slotAvailable=H1(()=>(this.images()?.length??0)<this.maxFile());canUpload=H1(()=>this.hasRole()&&this.slotAvailable());onRemove(c){let a=[...this.images()||[]];a.splice(c,1),this.imagesChange.emit(a)}openUploadDialog(){if(!this.canUpload())return;this.dialog.open(Ml,{data:{currentProductImagesLength:this.images()?.length??0,CloudinaryFolder:this.cloudinaryFolder(),productID:this.productID()}}).afterClosed().subscribe(a=>{a?.length&&(a=a.map(l=>Fo(kr({},l),{ProductID:this.productID()})),this.imagesChange.emit([...this.images()||[],...a]))})}onZoomImage(c,a){return nc(this,null,function*(){this.bigPicture.openBiggerPicture(a,c)})}drop(c){let a=[...this.images()||[]];G2(a,c.previousContainer.data,c.container.data),this.imagesChange.emit(a)}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-image-upload"]],inputs:{images:[1,"images"],maxFile:[1,"maxFile"],cloudinaryFolder:[1,"cloudinaryFolder"],productID:[1,"productID"]},outputs:{imagesChange:"imagesChange"},decls:4,vars:1,consts:[["cdkDropListGroup","",1,"d-flex","flex-wrap","gap-2","align-items-start","w-100"],["cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListData"],[1,"piu-upload-area",3,"matTooltip","piu-upload-area--full","piu-upload-area--shrink","piu-upload-area--disabled"],["cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListDropped","cdkDropListData"],["cdkDrag","",1,"piu-preview-item","cursor-pointer",3,"click"],["brokenImageIconFailSafe","",3,"src","alt"],[1,"piu-main-badge"],["type","button","aria-label","Remove image",1,"piu-remove-btn"],["type","button","aria-label","Remove image",1,"piu-remove-btn",3,"click"],[1,"piu-upload-area",3,"click","matTooltip"],[1,"text-center"],["aria-hidden","true",1,"fa-light","fa-image-circle-plus","fa-2x",2,"color","#9ca3af"],[1,"fa-light","fa-image-circle-plus","text-muted",2,"font-size","2rem"],[1,"piu-upload-label","mt-1","fs-6","text-muted"]],template:function(a,l){a&1&&(d(0,"div",0),Jt(1,kx,5,5,"div",1,vi),k(3,Ex,3,8,"div",2),p()),a&2&&(f(),Kt(l.images()),f(2),D(l.slotAvailable()?3:-1))},dependencies:[tr,nr,Ei,z2,Fv,Nv,Bv,kl],styles:[".piu-preview-item[_ngcontent-%COMP%]{position:relative;width:125px;height:125px;border-radius:6px;overflow:hidden;border:1px solid #e2e8f0;flex-shrink:0}.piu-preview-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.piu-preview-item[_ngcontent-%COMP%] .piu-main-badge[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;right:0;background:#0b5ed7d1;color:#fff;font-size:.6rem;font-weight:600;text-align:center;padding:2px 0;letter-spacing:.04em}.piu-preview-item[_ngcontent-%COMP%] .piu-remove-btn[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;border:none;background:#dc2626d9;color:#fff;font-size:.75rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s}.piu-preview-item[_ngcontent-%COMP%]:hover .piu-remove-btn[_ngcontent-%COMP%]{opacity:1}.piu-upload-area[_ngcontent-%COMP%]{border:1.5px dashed #d1d5db;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#fafafa;cursor:pointer;transition:border-color .15s,background .15s}.piu-upload-area[_ngcontent-%COMP%]:hover{border-color:#9ca3af;background:#f3f4f6}.piu-upload-area--full[_ngcontent-%COMP%]{width:100%;min-height:160px;flex-direction:column;gap:.25rem}.piu-upload-area--edit-mode[_ngcontent-%COMP%]{min-height:125px}.piu-upload-area--shrink[_ngcontent-%COMP%]{width:125px;height:125px;flex-shrink:0}.piu-upload-label[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#374151}.piu-upload-hint[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af}.piu-upload-area--disabled[_ngcontent-%COMP%]{opacity:.45;cursor:not-allowed}"],changeDetection:0})};var Md=class o{constructor(c,a){this.dialogRef=c;this.data=a;this.Model=a,this.configModal=new K1,this.configModal.title="Move to Category"}dialogRef;data;Model;configModal;onOk(){this.dialogRef.close({Model:this.Model})}static \u0275fac=function(a){return new(a||o)(se(X1),se($1))};static \u0275cmp=nt({type:o,selectors:[["POS-modal-move-category"]],standalone:!1,decls:6,vars:4,consts:[[3,"onOk","onCancel","onClose","config"],[1,"section-content",2,"width","332px","max-width","100%"],[1,"row"],[1,"col-sm-12"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),d(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"POS-product-category-select",4),je("selectedCategoryIDChange",function(m){return Oe(l.Model.Form.CategoryID,m)||(l.Model.Form.CategoryID=m),m}),p()()()()()()),a&2&&(M("config",l.configModal),f(5),Le("selectedCategoryID",l.Model.Form.CategoryID),M("showClear",!0)("continuedCategoriesOnly",!0))},dependencies:[Xo,k1],encapsulation:2})};var l0=(l=>(l[l.NEVER=0]="NEVER",l[l.QUERY=1]="QUERY",l[l.ALWAYS=2]="ALWAYS",l))(l0||{});function Px(o,c){if(o&1&&(d(0,"ng-conntainer")(1,"span",11),v(2),F(3,"async"),F(4,"number"),p()()),o&2){let a=x();f(2),Ae(Ce(4,3,Ce(3,1,a.totalRowCount$)))}}function Bx(o,c){if(o&1){let a=Se();d(0,"span",19)(1,"i",20),de("click",function(){U(a);let s=x();return Q(s.onShowTotal())}),v(2,"?"),p()()}}var Td=class o{constructor(c,a,l){this.data=c;this.dialogRef=a;this.httpService=l;this.modalConfig=new K1,this.modalConfig.title=c.title,this.modalConfig.headerType=Zi.Success}data;dialogRef;httpService;modalConfig;pageNumber=1;pageSize=1e4;startExport=1;endExport;isShowTotal=!1;totalCount=1e4;isExportCsv=!0;totalRowCount$;ngOnInit(){this.countExportRowCount()}onPageNumberChange(c){this.pageNumber=c,this.countExportRowCount()}exportCSV(){this.dialogRef.close(1)}ExportXlsx(){this.dialogRef.close(2)}countExportRowCount(){let c=1e4;this.pageNumber>1?(this.totalCount-this.pageNumber*c>0?this.endExport=this.pageNumber*c:this.endExport=this.totalCount,this.startExport=this.pageNumber-1==1?c+1:(this.pageNumber-1)*c+1,this.startExport>this.totalCount&&(this.startExport=this.totalCount)):(this.startExport=this.pageNumber,this.endExport=this.totalCount>c?c:this.totalCount)}onShowTotal(){this.isShowTotal=!0,this.totalRowCount$=this.httpService.post("/api/catalog/product/ProductRowsCount",{}).pipe(u1(c=>(this.totalCount=c.Count,this.countExportRowCount(),c.Count)))}onSave(){this.dialogRef.close({pageSize:this.pageSize,pageNumber:this.pageNumber,isExportCsv:this.isExportCsv})}onCancel(){this.dialogRef.close("CANCEL")}static \u0275fac=function(a){return new(a||o)(se($1),se(X1),se(ki))};static \u0275cmp=nt({type:o,selectors:[["POS-modal-export-product"]],standalone:!1,decls:36,vars:15,consts:[[3,"onCancel","onOk","config"],[1,"container-fluid"],[1,"row","border","p-4","border-secondary"],[1,"col-12","ps-0","d-flex","justify-content-center"],["aria-label","Select an option",3,"ngModelChange","ngModel"],[1,"me-4",3,"value"],[1,"fa-solid","fa-file-csv","me-1","fs-4"],[3,"value"],[1,"fa-solid","fa-file-excel","me-1","fs-4"],[1,"row","mt-8"],[1,"col-6","ps-0","pe-3"],[1,"fw-bold"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-6","pe-0","ps-3"],[1,"border","border-2","border-secondary","ps-3","pt-3","bg-light",2,"height","32px"],[1,"row","mt-4"],[1,"col-12","p-0"],[1,"border","border-1","ps-3","pt-3","alert-warning",2,"height","32px"],[1,"fa-solid","fa-circle-info","me-1"],[2,"cursor","pointer"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","py-1","px-3",3,"click"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onCancel",function(){return l.dialogRef.close()})("onOk",function(){return l.onSave()}),d(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"mat-radio-group",4),je("ngModelChange",function(m){return Oe(l.isExportCsv,m)||(l.isExportCsv=m),m}),d(6,"mat-radio-button",5),G(7,"i",6),v(8," Export CSV "),p(),d(9,"mat-radio-button",7),G(10,"i",8),v(11," Export XLSX "),p()()()(),d(12,"div",9)(13,"div",10)(14,"label",11),v(15,"Page Number"),p(),d(16,"input",12),je("ngModelChange",function(m){return Oe(l.pageNumber,m)||(l.pageNumber=m),m}),de("ngModelChange",function(m){return l.onPageNumberChange(m)}),p()(),d(17,"div",13)(18,"label",11),v(19,"Page Size"),p(),d(20,"div",14),v(21),F(22,"number"),p()()(),d(23,"div",15)(24,"div",16)(25,"div",17),G(26,"i",18),v(27," Exporting ["),d(28,"span",11),v(29),F(30,"number"),F(31,"number"),p(),v(32,"] record of "),k(33,Px,5,5,"ng-conntainer")(34,Bx,3,0,"span",19),v(35," transactions "),p()()()()()()),a&2&&(M("config",l.modalConfig),f(5),Le("ngModel",l.isExportCsv),f(),M("value",!0),f(3),M("value",!1),f(7),Le("ngModel",l.pageNumber),f(5),oe(" ",Ce(22,9,l.pageSize)),f(8),so("",Ce(30,11,l.startExport)," - ",Ce(31,13,l.endExport)),f(4),D(l.isShowTotal?33:34))},dependencies:[Ei,Xo,Cn,Vi,Ri,Ev,Tv,_o,w1,Li],encapsulation:2})};var Sg={Category:"Category",Product:"Product",ProductCode:"Product Code",Variant:"Variant",Code:"Code",Supplier:"Supplier",UnitCost:"Unit Cost",UnitPrice:"Unit Price",MinimumSellPrice:"Minimum Sell Price",LastBuyCost:"Last Buy Cost",MaximumBuyCost:"Maximum Buy Cost",CostDiscount:"Cost Discount",PriceDiscount:"Price Discount",LandedCost:"Landed Cost",Type:"Type",UOM:"UOM",Released:"Released",ProductID:"Product ID",ID:"ID",ProductDescription:"Product Description",Description:"Description",Discontinued:"Discontinued",VariantDiscontinued:"Variant Discontinued",PaymentType:"Payment Type",LoyaltyPoint:"Loyalty Point",Brand:"Brand",Taxable:"Taxable",ImageURL:"Image URL",VariantImageURL:"Variant Image URL",UnitQuantity:"Unit Quantity",Weight:"Weight",CostCurrency:"Cost Currency",ProductCostCurrency:"Product Cost Currency",VariantCostCurrency:"Variant Cost Currency"};var Fx=(o,c)=>({width:o,height:c}),kg=o=>({"text-decoration-line-through":o}),Vx=()=>["/menu/Products/Catalog/Products/Info"],Dg=o=>({ID:o}),Rx=()=>["/menu/Products/Catalog/Variants/Info"];function Ox(o,c){if(o&1){let a=Se();d(0,"th",3)(1,"input",10),de("change",function(s){U(a);let m=x();return Q(m.onSelectAllProducts(s.target.checked))}),p()()}}function Ux(o,c){o&1&&(d(0,"th",8),v(1,"Price"),p())}function Qx(o,c){if(o&1){let a=Se();d(0,"td",3)(1,"input",20),je("ngModelChange",function(s){U(a);let m=x().$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),p()()}if(o&2){let a=x().$implicit;f(),Le("ngModel",a.selected)}}function jx(o,c){if(o&1&&(d(0,"i",16),G(1,"br"),v(2),F(3,"sum"),F(4,"quantityFraction"),p()),o&2){let a=x().$implicit;f(2),oe(" ( ",Ce(4,4,Ie(3,1,a.Variants,"Inventory"))," On Hand ) ")}}function Lx(o,c){if(o&1&&(d(0,"i",23),v(1),p()),o&2){let a=x(3).$implicit;f(),Ae(" - "+a.Allocated+" Allocated ")}}function Hx(o,c){if(o&1&&k(0,Lx,2,1,"i",23),o&2){let a=x(2).$implicit;D(a.Allocated?0:-1)}}function qx(o,c){if(o&1&&(d(0,"i",16),v(1),F(2,"quantityFraction"),p(),k(3,Hx,1,1)),o&2){let a=x().$implicit;f(),oe("( ",a.Inventory==null?0:Ce(2,2,a.Inventory)," On Hand )"),f(2),D(a.TypeID!=2?3:-1)}}function Gx(o,c){if(o&1&&(d(0,"li",21)(1,"a",22)(2,"span"),v(3),p()(),d(4,"small"),v(5),p(),k(6,qx,4,4),p()),o&2){let a=c.$implicit,l=x(3);f(),M("target",pv(l.pageData.LinkTarget))("routerLink",ft(9,Rx))("queryParams",ot(10,Dg,a.ID)),f(),Jo(ot(12,kg,a.Discontinued)),f(),Ae(a.Model),f(2),Ae(a.Code),f(),D(l.roleService.inventory.View&&(l.pageData.InventoryRenderScenario==l.renderScenario.ALWAYS||l.pageData.InventoryRenderScenario==l.renderScenario.QUERY&&l.pageData.Filter.Text)?6:-1)}}function zx(o,c){if(o&1&&(d(0,"ul",18),Jt(1,Gx,7,14,"li",21,vi),p()),o&2){let a=x().$implicit;f(),Kt(a.Variants)}}function Yx(o,c){if(o&1&&(v(0),F(1,"MinToMax")),o&2){let a=x(2).$implicit;oe(" ",Ie(1,1,a.Variants,"UnitPrice")," ")}}function Wx(o,c){if(o&1&&(d(0,"td",19),k(1,Yx,2,4),p()),o&2){let a=x().$implicit;f(),D(a.Variants?1:-1)}}function Jx(o,c){if(o&1){let a=Se();d(0,"tr"),k(1,Qx,2,1,"td",3),d(2,"td")(3,"div",11)(4,"div",12)(5,"img",13),de("click",function(s){let m=U(a).$implicit,h=x();return Q(h.onOpenBigPicture(m,s))}),p()(),d(6,"div",14)(7,"a",15),v(8),p()()()(),d(9,"td"),v(10),k(11,jx,5,6,"i",16),p(),d(12,"td"),v(13),p(),d(14,"td",17),k(15,zx,3,0,"ul",18),p(),k(16,Wx,2,1,"td",19),d(17,"td"),v(18),F(19,"date"),p()()}if(o&2){let a=c.$implicit,l=x();f(),D(l.roleService.product!=null&&l.roleService.product.Delete||l.roleService.product!=null&&l.roleService.product.Edit?1:-1),f(4),Os(Ko(23,Fx,l.data.ThumbnailWidth+"px",l.data.ThumbnailWidth+"px")),M("src",a.ThumbnailUrl,vl)("width",l.data.ThumbnailWidth+"px")("height",l.data.ThumbnailWidth+"px")("linkTarget",l.pageData.LinkTarget)("redirectUrl","/menu/Products/Catalog/Products/Info/?ID="+a.ID),f(2),Jo(ot(26,kg,a.Discontinued)),M("routerLink",ft(28,Vx))("queryParams",ot(29,Dg,a.ID))("target",l.pageData.LinkTarget),f(),Ae(a.Name),f(2),oe(" ",a.Code," "),f(),D(l.roleService.inventory.View&&(l.pageData.InventoryRenderScenario==l.renderScenario.ALWAYS||l.pageData.InventoryRenderScenario==l.renderScenario.QUERY&&l.pageData.Filter.Text)?11:-1),f(2),oe(" ",a.Category," "),f(2),D(a.Variants?15:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible?16:-1),f(2),oe(" ",a.Released==l.minDate?"":Ie(19,20,a.Released,"dd MMM yy")," ")}}var Pd=class o{constructor(c){this.roleService=c}roleService;data;infiniteList;pageData;maskingFields;maskingFieldMsg=T2.maskingField;minDate=Qi.MinDate;selectAllProducts=new y2;openBigPicture=new y2;sort=new y2;renderScenario=l0;onSelectAllProducts(c){this.selectAllProducts.emit(c)}onOpenBigPicture(c,a){this.openBigPicture.emit({product:c,pEvent:a})}sortData(c){this.sort.emit(c)}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-product-list-desktop"]],inputs:{data:"data",infiniteList:"infiniteList",pageData:"pageData",maskingFields:"maskingFields"},outputs:{selectAllProducts:"selectAllProducts",openBigPicture:"openBigPicture",sort:"sort"},standalone:!1,decls:18,vars:2,consts:[["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","14px"],[2,"width","320px"],["mat-sort-header","Code",2,"width","120px"],[2,"width","110px"],[2,"width","300px","max-width","300px"],[1,"text-end",2,"width","140px"],[2,"width","80px"],["type","checkbox",3,"change"],[1,"d-flex","flex-row"],[2,"cursor","pointer","flex-shrink","0"],["matTooltipPosition","above","matTooltip","Click to zoom","brokenImageIconFailSafe","",1,"product-thumbnail",3,"click","src","width","height","linkTarget","redirectUrl"],[1,"ps-2"],[1,"align-top",3,"routerLink","queryParams","target"],[1,"text-danger","small"],[1,"variant-cell"],[1,"nav"],[1,"text-end"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"nav-item","me-8"],[1,"nav-link",2,"padding","0",3,"routerLink","queryParams","target"],[1,"small"]],template:function(a,l){a&1&&(d(0,"table",0),de("matSortChange",function(m){return l.sortData(m)}),d(1,"thead",1)(2,"tr",2),k(3,Ox,2,0,"th",3),d(4,"th",4),v(5,"Product"),p(),d(6,"th",5),v(7,"Code"),p(),d(8,"th",6),v(9,"Category"),p(),d(10,"th",7),v(11,"Variants"),p(),k(12,Ux,2,0,"th",8),d(13,"th",9),v(14,"Released"),p()()(),d(15,"tbody"),Jt(16,Jx,20,31,"tr",null,vi),p()()),a&2&&(f(3),D(l.roleService.product!=null&&l.roleService.product.Delete||l.roleService.product!=null&&l.roleService.product.Edit?3:-1),f(9),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible?12:-1),f(4),Kt(l.infiniteList))},dependencies:[Ei,li,A1,Vi,Ri,S1,I1,kl,Vn,el,Rv,J2],styles:[".product-thumbnail[_ngcontent-%COMP%]{object-fit:cover;border-radius:4px}.variant-cell[_ngcontent-%COMP%]{max-width:300px}.variant-cell[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%]{display:flex;flex-direction:column}@media(max-width:991.98px){.variant-cell[_ngcontent-%COMP%]{max-width:none;overflow-x:auto}.variant-cell[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%]{flex-wrap:nowrap;width:max-content}}"],changeDetection:0})};var $x=()=>["/menu/Products/Catalog/Products/Import"],Zx=()=>["/menu/Products/Catalog/Products/Form"];function e_(o,c){if(o&1){let a=Se();d(0,"a",17),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkDiscontinue"))}),G(1,"i",18),v(2," Discontinue "),p()}}function t_(o,c){if(o&1){let a=Se();d(0,"a",17),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkReactivate"))}),G(1,"i",19),v(2," Continue "),p()}}function i_(o,c){if(o&1&&k(0,e_,3,0,"a",16)(1,t_,3,0,"a",16),o&2){let a=x(2);D(a.pageData().Filter.ProductDiscontinued?1:0)}}function n_(o,c){if(o&1){let a=Se();d(0,"a",20),de("click",function(){U(a);let s=x(2);return Q(s.httpPostListID("catalog/product/DeleteProductList"))}),G(1,"i",21),v(2," Delete "),p()}}function a_(o,c){if(o&1){let a=Se();d(0,"a",23),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkDiscontinue"))}),G(1,"i",19),v(2," Discontinue "),p()}}function r_(o,c){if(o&1){let a=Se();d(0,"a",23),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkReactivate"))}),G(1,"i",18),v(2," Continue "),p()}}function o_(o,c){if(o&1&&(d(0,"li",15),k(1,a_,3,0,"a",22)(2,r_,3,0,"a",22),p()),o&2){let a=x(2);f(),D(a.pageData().Filter.ProductDiscontinued?2:1)}}function l_(o,c){if(o&1){let a=Se();d(0,"li",15)(1,"a",24),de("click",function(){U(a);let s=x(2);return Q(s.mergeData())}),G(2,"i",25),v(3," Merge Variant "),p()()}}function s_(o,c){if(o&1){let a=Se();d(0,"li",15)(1,"a",26),de("click",function(){U(a);let s=x(2);return Q(s.moveProduct("catalog/product/MoveProduct"))}),G(2,"i",27),v(3," Move "),p()()}}function c_(o,c){if(o&1&&(d(0,"div",2),k(1,i_,2,1)(2,n_,3,0,"a",12),G(3,"button",13),d(4,"ul",14),k(5,o_,3,1,"li",15),k(6,l_,4,0,"li",15),k(7,s_,4,0,"li",15),p()()),o&2){let a=x();f(),D(a.roleService.product!=null&&a.roleService.product.Delete?2:1),f(4),D(a.roleService.product!=null&&a.roleService.product.Delete?5:-1),f(),D(a.getSelectedData().length>1&&(a.roleService.product!=null&&a.roleService.product.Edit)?6:-1),f(),D(a.roleService.product!=null&&a.roleService.product.Edit?7:-1)}}function d_(o,c){o&1&&(d(0,"a",3),G(1,"i",28),v(2," Import"),p()),o&2&&M("routerLink",ft(1,$x))}function p_(o,c){if(o&1){let a=Se();d(0,"a",29),de("click",function(){U(a);let s=x();return Q(s.openExportModal())}),G(1,"i",30),v(2," Export "),p()}}function m_(o,c){o&1&&(d(0,"a",5),v(1,"Add"),p()),o&2&&M("routerLink",ft(1,Zx))}function f_(o,c){if(o&1&&(d(0,"div",49)(1,"span",50),v(2),p(),d(3,"span",51),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function u_(o,c){if(o&1&&(d(0,"div",49)(1,"span",50),v(2),p(),d(3,"span",51),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function v_(o,c){if(o&1){let a=Se();d(0,"div",31)(1,"div",32)(2,"h6"),v(3,"Category"),p(),d(4,"POS-product-category-select",33),je("selectedCategoryIDChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.CategoryID,s)||(m.pageData().Filter.CategoryID=s),Q(s)}),p()(),d(5,"div",32)(6,"h6"),v(7,"Brand"),p(),d(8,"POS-brand-options-v2",34),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.BrandIDs,s)||(m.pageData().Filter.BrandIDs=s),Q(s)}),p()(),d(9,"div",32)(10,"h6"),v(11,"Tags"),p(),d(12,"ng-select",35),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.TagsID,s)||(m.pageData().Filter.TagsID=s),Q(s)}),p()(),d(13,"div",32)(14,"h6"),v(15,"Supplier"),p(),d(16,"autocompleteV2",36),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.SupplierID,s)||(m.pageData().Filter.SupplierID=s),Q(s)}),p()(),d(17,"div",32)(18,"h6"),v(19,"Released From"),p(),d(20,"datepicker",37),je("dateChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.From,s)||(m.pageData().Filter.From=s),Q(s)}),p()(),d(21,"div",32)(22,"h6"),v(23,"Released To"),p(),d(24,"datepicker",38),je("dateChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.To,s)||(m.pageData().Filter.To=s),Q(s)}),p()(),d(25,"div",32)(26,"h6"),v(27,"Cost Currency"),p(),d(28,"ng-select",39),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.ProductCostCurrencyID,s)||(m.pageData().Filter.ProductCostCurrencyID=s),Q(s)}),_i(29,f_,5,2,"ng-template",40)(30,u_,5,2,"ng-template",41),p()(),d(31,"div",32)(32,"h6"),v(33,"Order By"),p(),d(34,"radio-options",42),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.OrderBy,s)||(m.pageData().Filter.OrderBy=s),Q(s)}),p()(),d(35,"div",32)(36,"h6"),v(37,"Order Direction"),p(),d(38,"radio-options",43),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.SortBy,s)||(m.pageData().Filter.SortBy=s),Q(s)}),p()(),d(39,"div",32)(40,"h6"),v(41,"Category Discontinued"),p(),d(42,"radio-options",44),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.CategoryDiscontinued,s)||(m.pageData().Filter.CategoryDiscontinued=s),Q(s)}),p()(),d(43,"div",32)(44,"h6"),v(45,"Product Discontinued"),p(),d(46,"radio-options",45),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.ProductDiscontinued,s)||(m.pageData().Filter.ProductDiscontinued=s),Q(s)}),p()(),d(47,"div",32)(48,"h6"),v(49,"Variant Discontinued"),p(),d(50,"radio-options",46),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.VariantDiscontinued,s)||(m.pageData().Filter.VariantDiscontinued=s),Q(s)}),p()(),d(51,"div",32)(52,"h6"),v(53,"Search Mode"),p(),d(54,"radio-options",47),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.SearchMode,s)||(m.pageData().Filter.SearchMode=s),Q(s)}),p()(),d(55,"div",32)(56,"h6"),v(57,"Inventory By Outlet Group"),p(),d(58,"ng-select",48),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.EntityGroupID,s)||(m.pageData().Filter.EntityGroupID=s),Q(s)}),p()()()}if(o&2){let a,l,s,m,h,_,w,A,I=x();f(4),Le("selectedCategoryID",I.pageData().Filter.CategoryID),M("showClear",!0)("continuedCategoriesOnly",!0),f(4),Le("ngModel",I.pageData().Filter.BrandIDs),M("multiple",!0)("placeholder","Choose Brand")("clearable",!0),f(4),M("items",(a=I.pageData().Options)==null?null:a.Tags),Le("ngModel",I.pageData().Filter.TagsID),f(4),Le("ngModel",I.pageData().Filter.SupplierID),f(4),Le("date",I.pageData().Filter.From),f(4),Le("date",I.pageData().Filter.To),f(4),M("items",I.pageData().Options.CurrencyOptions),Le("ngModel",I.pageData().Filter.ProductCostCurrencyID),f(6),Le("model",I.pageData().Filter.OrderBy),M("options",(l=I.pageData().Options)==null?null:l.OrderByOptions),f(4),Le("model",I.pageData().Filter.SortBy),M("options",(s=I.pageData().Options)==null?null:s.SortByOptions),f(4),Le("model",I.pageData().Filter.CategoryDiscontinued),M("options",(m=I.pageData().Options)==null?null:m.CategoryDiscontinuedOptions),f(4),Le("model",I.pageData().Filter.ProductDiscontinued),M("options",(h=I.pageData().Options)==null?null:h.ProductDiscontinuedOptions),f(4),Le("model",I.pageData().Filter.VariantDiscontinued),M("options",(_=I.pageData().Options)==null?null:_.VariantDiscontinuedOptions),f(4),Le("model",I.pageData().Filter.SearchMode),M("options",(w=I.pageData().Options)==null?null:w.SearchModeOptions),f(4),M("items",(A=I.pageData().Options)==null?null:A.EntityGroups),Le("ngModel",I.pageData().Filter.EntityGroupID)}}function g_(o,c){if(o&1){let a=Se();d(0,"infinite-pagination",52),de("nextPage",function(){U(a);let s=x();return Q(s.NextPage(!0))})("fetchTotalData",function(){U(a);let s=x();return Q(s.StoreRowsCountAPIResult("catalog/product/ProductRowsCount"))}),p()}if(o&2){let a,l,s=x();M("totalData",s.listTotal())("totalCurrentRow",s.infiniteList==null?null:s.infiniteList.length)("pageNumber",(a=s.pageData())==null||a.Filter==null?null:a.Filter.PageNumber)("nextPageDisabled",!1)("hasShowAllButton",!1)("isFetchTotalData",(l=s.pageData())==null?null:l.HideStoreApiCount)}}var Bd=class o extends fs{constructor(a,l,s,m,h,_,w){super(a,l,"catalog/product/GetProductList","catalog/ProductLoader/ProductList",s,w);this.httpService=l;this.csvConverter=m;this.matDialog=h;this.roleService=_}httpService;csvConverter;matDialog;roleService;bigPicture=dn(vs);minDate=Qi.MinDate;more=!1;maskingFields;renderScenario=l0;isHasBrandRestriction=H1(()=>!!this.pageData().Filter.BrandIDs&&this.pageData().Filter.BrandIDs.length>0&&!this.brandIdSelectedChange());brandIdSelectedChange=Qe(!1);trackByKey=(a,l)=>l.Key;preInitList(){let a=this.route?.snapshot?.queryParams?.BrandID;Qi.IsNotEmpty(a)&&(this.pageData().Filter.BrandID=a)}preGetList(){super.preGetList();let{categoryID:a}=this.route?.snapshot?.queryParams;Qi.IsNotEmpty(a)&&(this.pageData().Filter.CategoryID=a)}postInit(a){super.postInit(a),this.maskingFields=Qi.generateMaskingField(this.pageData().MaskFields)}Select_Export(){this.matDialog.open(Td,{data:{title:"Export Products"},width:"400px"}).afterClosed().pipe(ql(l=>l!=="CANCEL")).subscribe(l=>{this.pageData().Filter.ExportPageNumber=l.pageNumber,this.pageData().Filter.ExportRowCount=l.pageSize,l.isExportCsv?this.exportCSV(this.csvConverter,"ProductExport/ExportProductList","Product.csv"):this.exportXlsx("ProductExport/ExportProductListExcel")})}moveProduct(a){let l=this.getSelectedData();this.matDialog.open(Md,{data:{Form:{CategoryID:null},Options:this.pageData().Options}}).afterClosed().subscribe(m=>{if(m){let h=m.Model.Form.CategoryID,_=l.map(w=>w.ID);this.postData(a,{ID:h,List:_})}})}s2ab(a){for(var l=new ArrayBuffer(a.length),s=new Uint8Array(l),m=0;m!=a.length;++m)s[m]=a.charCodeAt(m)&255;return l}exportXlsx(a){this.pageData().Filter.FormatType=1,this.httpService.post(`/api/${a}`,this.pageData().Filter).subscribe(l=>{let s="Product.xlsx";s=decodeURI(s);let m=window.URL.createObjectURL(new Blob([this.s2ab(atob(l))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),h=document.createElement("a");h.href=m,h.setAttribute("download",s),document.body.appendChild(h),h.click(),window.URL.revokeObjectURL(m),h.remove()})}mergeData(){let a=this.getSelectedData();this.matDialog.open(cg,{data:{data:a,title:"Choose Merge Target",actionTitle:"Move",columns:[{type:"text",field:"Name"},{type:"text",field:"Code"}],headers:["Name","Code"]},width:"500px"}).afterClosed().pipe(ql(l=>l),Gl(l=>this.mergeVariant(l.mergeTarget,l.deleted))).subscribe(()=>{this.toastrService?.success("Variant records have been merged successfully.",Zi.Success),this.getListData()})}mergeVariant(a,l){let s={mergeTarget:a,deleted:l};return this.httpService.put(Da.MergeProduct,s)}openBiggerPicture(a){return nc(this,null,function*(){this.bigPicture.openBiggerPicture(a.pEvent,a.product.ImageUrl)})}openExportModal(){let a=this.pageData().Options?.ExportColumnOptions,l=a?.length?"product-export/default-with-selection":"ProductExport/ExportProductList";this.matDialog.open(Kr,{data:{title:"Product",exportTypes:[{ID:l,Value:"Default",FileName:"Product"},{ID:"ProductExport/ExportProductListWithOutletPrice",Value:"Outlet Price",FileName:"Export with Outlet Price"},{ID:"ProductExport/ExportProductListWithPricebook",Value:"Pricebook",FileName:"Export with Pricebook"},{ID:"ProductExport/ExportProductListWithComponents",Value:"Components",FileName:"Export with Components"},{ID:"ProductExport/ExportProductListWithParent",Value:"Multi Unit",FileName:"Export with Multi Unit"},{ID:"ProductExport/ExportProductListWithSerial",Value:"Serial",FileName:"Export with Serial"},{ID:"ProductExport/ExportProductListWithSerialAndRow",Value:"Serial and Row",FileName:"Export with Serial and Row"},{ID:"ProductExport/ExportProductListWithTags",Value:"Tags",FileName:"Export with Tags"},{ID:"ProductExport/ExportProductListWithSalesGroupCommission",Value:"Commission",FileName:"Export with Commission"},{ID:"ProductExport/ExportProductListWithInventory",Value:"Inventory",FileName:"Export with Inventory"},{ID:"ProductExport/ExportProductListWithWarehouseLocation",Value:"Warehouse",FileName:"Export with Warehouse"},{ID:"ProductExport/ExportProductListMinMaxWithInventory",Value:"ROP & Max Inventory",FileName:"Export with ROP & Max Inventory"},{ID:"ProductExport/ExportProductListWithPreapaid",Value:"Prepaid",FileName:"Export with Prepaid"},{ID:"ProductExport/ExportProductListDigitalScale",Value:"Digital Scale",TxtOnly:!0},{ID:"ProductExport/ExportProductListWithDisplayName",Value:"Display Name",FileName:"Export with Display Name"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"catalog/product/ProductRowsCount",pagination:!0,extraExportTypesOptions:[{value:"TXT",label:"TXT",icon:"fa-file-invoice fas",formatType:2}],exportColumnOptions:a,exportColumnDefaultCount:10,customizeColumnsExportType:"product-export/default-with-selection",exportColumnDisplayMap:Sg}})}sortData(a){let l=this.infiniteList.slice();if(!a.active||a.direction===""){this.infiniteList=this.originalData();return}this.infiniteList=l.sort((s,m)=>{let h=a.direction==="asc",_=typeof s[a.active];switch(Qi.IsEmpty(s.Code)&&(s.Code=""),Qi.IsEmpty(m.Code)&&(m.Code=""),_){case"string":return Qi.compare(s[a.active].toLocaleLowerCase(),m[a.active].toLocaleLowerCase(),h);case"number":return Qi.compare(s[a.active],m[a.active],h);default:return 0}})}onFilterBrand(a){this.pageData().Filter.BrandIDs=a,this.brandIdSelectedChange.set(!0)}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(zi),se(Z1),se(Ma),se(yi),se(Jn))};static \u0275cmp=nt({type:o,selectors:[["POS-product"]],standalone:!1,features:[$i],decls:17,vars:13,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary"],["data-cy","AddProduct","role","button","matTooltipPosition","above","matTooltip","Add Product",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[3,"selectAllProducts","openBigPicture","sort","data","infiniteList","pageData","maskingFields"],[1,"me-auto","mt-3"],[1,"fw-bold","fst-italic"],[3,"totalData","totalCurrentRow","pageNumber","nextPageDisabled","hasShowAllButton","isFetchTotalData"],["data-cy","DeleteProduct",1,"btn","btn-outline-secondary","border-end-0"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item"],["data-cy","DiscountinueProduct",1,"btn","btn-outline-secondary","border-end-0"],["data-cy","DiscountinueProduct",1,"btn","btn-outline-secondary","border-end-0",3,"click"],[1,"fa-solid","fa-ban"],[1,"fa-solid","fa-circle-check"],["data-cy","DeleteProduct",1,"btn","btn-outline-secondary","border-end-0",3,"click"],[1,"fa-solid","fa-trash"],["data-cy","DiscountinueProduct"],["data-cy","DiscountinueProduct",3,"click"],["title","2 products with 1 variant each will be merged into 1 product with 2 variants",3,"click"],[1,"fa-solid","fa-merge"],["matTooltipPosition","above","matTooltip","Move",3,"click"],[1,"fa-solid","fa-arrows-up-down-left-right"],["aria-hidden","true",1,"fa-solid","fa-download"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose Category...",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],[3,"ngModelChange","ngModel","multiple","placeholder","clearable"],["bindLabel","Name","bindValue","ID","placeholder","Choose Tag...",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier...",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],["bindValue","Key","bindLabel","Value","placeholder","Choose Currency...","appendTo","body",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["name","OrderBy",3,"modelChange","model","options"],["name","SortBy",3,"modelChange","model","options"],["name","CategoryDiscontinued",3,"modelChange","model","options"],["name","ProductDiscontinued",3,"modelChange","model","options"],["name","VariantDiscontinued",3,"modelChange","model","options"],["name","SearchMode",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],[3,"nextPage","fetchTotalData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","hasShowAllButton","isFetchTotalData"]],template:function(l,s){if(l&1){let m=Se();d(0,"mainpanel-cmp",1),je("textChange",function(_){return U(m),Oe(s.pageData().Filter.Text,_)||(s.pageData().Filter.Text=_),Q(_)}),de("onSubmit",function(){return s.searchFromPageOne()}),je("filterChange",function(_){return U(m),Oe(s.pageData().Filter,_)||(s.pageData().Filter=_),Q(_)}),d(1,"actions"),k(2,c_,8,4,"div",2),d(3,"div",2),k(4,d_,3,2,"a",3),k(5,p_,3,0,"a",4),p(),k(6,m_,2,2,"a",5),p(),d(7,"filters"),_i(8,v_,59,28,"ng-template",null,0,co),p(),d(10,"content")(11,"div",6)(12,"div",7)(13,"POS-product-list-desktop",8),de("selectAllProducts",function(_){return s.onSelectAllData(_)})("openBigPicture",function(_){return s.openBiggerPicture(_)})("sort",function(_){return s.sortData(_)}),p()(),d(14,"div",9)(15,"div",10),k(16,g_,1,6,"infinite-pagination",11),p()()()()()}l&2&&(M("pageData",s.menuData()),Le("text",s.pageData().Filter.Text),M("isFilterOnDropdown",!1),Le("filter",s.pageData().Filter),f(2),D(s.getSelectedData().length>0&&(s.roleService.product!=null&&s.roleService.product.Edit||s.roleService.product!=null&&s.roleService.product.Delete)?2:-1),f(2),D(!(s.roleService==null||s.roleService.product==null)&&s.roleService.product.Create&&(!(s.roleService==null||s.roleService.product==null)&&s.roleService.product.Edit)?4:-1),f(),D(!(s.roleService==null||s.roleService.global==null)&&s.roleService.global.Export?5:-1),f(),D(s.roleService.product!=null&&s.roleService.product.Create?6:-1),f(7),M("data",s.data())("infiniteList",s.infiniteList)("pageData",s.pageData())("maskingFields",s.maskingFields),f(3),D(s.infiniteList.length>0?16:-1))},dependencies:[Ei,tn,li,Vi,Ri,$o,Xr,Co,Il,k1,tl,Y2,W2,xc,Pd],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}@media(max-width:575.98px){.table-responsive[_ngcontent-%COMP%]{font-size:.8rem}.table-responsive[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{min-width:640px}}"]})};var Fd=class o{constructor(c,a){this.data=c;this.dialogRef=a;this.modalConfig=new K1,this.modalConfig.title=c.title,this.modalConfig.headerType=Zi.Error}data;dialogRef;modalConfig;onOk(){this.dialogRef.close("REMOVE")}static \u0275fac=function(a){return new(a||o)(se($1),se(X1))};static \u0275cmp=nt({type:o,selectors:[["POS-modal-confirm-remove"]],standalone:!1,decls:7,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"section-content",2,"width","100%"],[1,"row"],[1,"col-sm-12"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),d(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"h5"),v(6),p()()()()()()),a&2&&(M("config",l.modalConfig),f(6),Ae(l.data.message))},dependencies:[Xo],encapsulation:2})};function Vd(o,c){return Array.isArray(o)?o.flatMap(a=>(a?.events??[]).map(l=>({id:l?.id,title:b_(l,c),description:l?.details??void 0,timestamp:l?.timestamp,meta:{CreatorName:l?.actor?.name??""},state:"completed"}))):[]}function b_(o,c){let a=o?.title?.trim();if(a)return a;let l=o?.action??"";return c[l]??l}var Rd=class o{data=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-additional-information"]],inputs:{data:[1,"data"]},standalone:!1,decls:17,vars:6,consts:[[1,"row","m-0","p-0"],[1,"col-6","mb-6"],[1,"mb-2"],[1,"form-control","info-display"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"label",2),v(3,"Release Date"),p(),d(4,"div",3),v(5),F(6,"date"),p()(),d(7,"div",1)(8,"label",2),v(9,"Cost Currency"),p(),d(10,"div",3),v(11),p()(),d(12,"div",1)(13,"label",2),v(14,"Cross Sell Product"),p(),d(15,"div",3),v(16),p()()()),a&2&&(f(5),oe(" ",Ie(6,3,l.data().Product.Released,"dd MMM yyyy")," "),f(6),oe(" ",l.data().ProductCurrency.CostCurrencySymbol+" - "+l.data().ProductCurrency.CostCurrencyName," "),f(5),oe(" ",l.data().Product.NextProductName," "))},dependencies:[Vn],styles:["label[_ngcontent-%COMP%]{font-size:.813rem}.info-display[_ngcontent-%COMP%]{height:2.375rem;padding:.375rem .75rem;font-size:.75rem;border:1px solid #dee2e6;border-radius:.25rem;background:#fff;color:#495057;display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]})};var Od=class o{description=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-description"]],inputs:{description:[1,"description"]},standalone:!1,decls:3,vars:2,consts:[[1,"row","m-0","p-0"],[1,"col-12"],["labelValue","Description","inputType","textarea",3,"inputValue","labelVisible"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1),G(2,"lib-info-page-input",2),p()()),a&2&&(f(2),M("inputValue",l.description())("labelVisible",!1))},dependencies:[il],encapsulation:2})};function C_(o,c){o&1&&(G(0,"i",5),d(1,"span",6),v(2,"Description"),p())}function y_(o,c){o&1&&(G(0,"i",7),d(1,"span",6),v(2,"More Settings"),p())}var Ud=class o{data=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-nav-tab"]],inputs:{data:[1,"data"]},standalone:!1,decls:9,vars:3,consts:[[1,"info-product-tab",3,"mat-stretch-tabs"],["mat-tab-label",""],[1,"mt-10"],[3,"description"],[3,"data"],[1,"fa-solid","fa-text","me-3","pb-1"],[1,"fs-5"],[1,"fa-solid","fa-circle-info","me-3","pb-1"]],template:function(a,l){a&1&&(d(0,"mat-tab-group",0)(1,"mat-tab"),_i(2,C_,3,0,"ng-template",1),d(3,"div",2),G(4,"POS-info-product-description",3),p()(),d(5,"mat-tab"),_i(6,y_,3,0,"ng-template",1),d(7,"div",2),G(8,"POS-info-product-additional-information",4),p()()()),a&2&&(M("mat-stretch-tabs",!1),f(4),M("description",l.data().Product.Description),f(4),M("data",l.data()))},dependencies:[U2,Q2,j2,Rd,Od],styles:["mat-tab-group.info-product-tab mat-tab-header{border-bottom:1px solid #e0e0e0}"]})};var I_=()=>["/menu/Products/Log/Product_History"],of=o=>({ProductID:o}),k_=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],D_=()=>["/menu/Reports/Purchases_Report/History"],M_=()=>["/menu/Products/Catalog/Products/Form"],lf=o=>({ID:o}),E_=()=>["/menu/Products/Catalog/Products/Inventory"],T_=o=>({"text-decoration":o}),P_=()=>["/menu/Products/Catalog/Variants/Info"],B_=(o,c)=>c.key;function N_(o,c){if(o&1&&(d(0,"div",1)(1,"a",52),G(2,"i",53),v(3," Sales History"),p(),G(4,"button",54),d(5,"ul",55)(6,"li")(7,"a",56),v(8,"Purchase History "),p()()()()),o&2){let a,l,s=x(2);f(),M("routerLink",ft(4,k_))("queryParams",ot(5,of,(a=s.data())==null||a.Product==null?null:a.Product.ID)),f(6),M("routerLink",ft(7,D_))("queryParams",ot(8,of,(l=s.data())==null||l.Product==null?null:l.Product.ID))}}function F_(o,c){if(o&1&&(d(0,"a",3),G(1,"i",57),v(2," Edit"),p()),o&2){let a,l=x(2);M("routerLink",ft(2,M_))("queryParams",ot(3,lf,(a=l.data())==null||a.Product==null?null:a.Product.ID))}}function V_(o,c){if(o&1){let a=Se();d(0,"a",58),de("click",function(){U(a);let s=x(2);return Q(s.removeProduct())}),G(1,"i",59),v(2," Delete"),p()}}function R_(o,c){if(o&1){let a=Se();d(0,"i",60),de("click",function(){U(a);let s=x(2);return Q(s.switchProductCodeType())}),p()}if(o&2){let a=x(2);M("matTooltip",a.variantColumnDisplayService.productCodeType()==="code"?"Hide Hexacode":"Display code in Hexadecimal format instead of ASCII for RFID Encoding")}}function O_(o,c){o&1&&(d(0,"div",16)(1,"label",18),v(2,"Hexacode"),p()())}function U_(o,c){if(o&1&&(d(0,"div",16)(1,"div",17),v(2),p()()),o&2){let a=x(2);f(2),oe(" ",a.data().Product.Hexacode," ")}}function Q_(o,c){if(o&1){let a=Se();d(0,"div")(1,"label",18),v(2,"Product Image"),p(),d(3,"POS-info-product-image-upload",61),de("imagesChange",function(s){U(a);let m=x(2);return Q(m.onImagesChange(s))}),p()()}if(o&2){let a=x(2);f(3),M("images",a.productImages)("maxFile",a.maxFile)("cloudinaryFolder",a.data().CloudinaryFolder)("productID",a.data().Product.ID)}}function j_(o,c){if(o&1&&(d(0,"div",22),v(1),p()),o&2){let a=x(2);M("matTooltip",a.maskingFieldMsg),f(),oe(" ",a.data().Product.SupplierName," ")}}function L_(o,c){if(o&1){let a=Se();d(0,"div",19),de("click",function(){U(a);let s=x(2);return Q(s.goToSupplierInfo(s.data().Product.SupplierID))}),v(1),p()}if(o&2){let a=x(2);f(),oe(" ",a.data().Product.SupplierName," ")}}function H_(o,c){if(o&1&&(d(0,"span",62),F(1,"date"),v(2),p()),o&2){let a=c.$implicit;M("matTooltip",Ie(1,2,a.Released,"dd MMM yyyy")),f(2),oe(" ",a.Name," ")}}function q_(o,c){if(o&1&&Jt(0,H_,3,5,"span",62,vi),o&2){let a=x(2);Kt(a.data().Form.Tags)}}function G_(o,c){o&1&&(d(0,"span",66),v(1,"*"),p())}function z_(o,c){if(o&1){let a=Se();d(0,"li",35)(1,"div",63),de("click",function(s){return s.stopPropagation()}),d(2,"p-checkbox",64),je("ngModelChange",function(s){let m=U(a).$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),de("onChange",function(){let s=U(a).$implicit,m=x(2);return Q(m.variantColumnDisplayService.toggleColumn(s.key))}),p(),d(3,"label",65),v(4),p(),k(5,G_,2,0,"span",66),p()()}if(o&2){let a=c.$implicit;f(2),Le("ngModel",a.selected),M("binary",!0)("inputId","col-"+a.key),f(),M("for","col-"+a.key),f(),oe(" ",a.name??a.key," "),f(),D(a.advanced?5:-1)}}function Y_(o,c){if(o&1&&(d(0,"a",36),v(1,"Outlet Inventory"),p()),o&2){let a=x(2);M("routerLink",ft(2,E_))("queryParams",ot(3,lf,a.data().Product.ID))}}function W_(o,c){if(o&1){let a=Se();d(0,"i",60),de("click",function(){U(a);let s=x(3);return Q(s.toggleVariantHexacodeColumn())}),p()}if(o&2){let a=x(3);M("matTooltip",a.variantColumnDisplayService.productCodeType()==="code"?"Hide Hexacode":"Display code in Hexadecimal format instead of ASCII for RFID Encoding")}}function J_(o,c){if(o&1&&(d(0,"th",41)(1,"div",28)(2,"div"),v(3),p(),k(4,W_,1,1,"i",15),p()()),o&2){let a=x(2);f(3),oe(" ",a.variantColumnDisplayService.columnsToDisplay.Code.name," "),f(),D(a.hasHexacodeVariant?4:-1)}}function K_(o,c){if(o&1&&(d(0,"th",42),v(1),p()),o&2){let a=x(2);f(),oe(" ",a.variantColumnDisplayService.columnsToDisplay.Hexacode.name," ")}}function X_(o,c){o&1&&(d(0,"th",43),v(1," Buying Cost "),p())}function $_(o,c){o&1&&(d(0,"th",43),v(1," Selling Price "),p())}function Z_(o,c){o&1&&(d(0,"th",44),v(1," % "),p())}function e6(o,c){o&1&&(d(0,"th",45),v(1," Minimum Price "),p())}function t6(o,c){o&1&&(d(0,"th",46),v(1," Weight (gr) "),p())}function i6(o,c){o&1&&(d(0,"th",46),v(1," Inventory "),p())}function n6(o,c){o&1&&(d(0,"th",47),v(1,"Ratio"),p())}function a6(o,c){o&1&&(d(0,"th",48),v(1," Reference "),p())}function r6(o,c){if(o&1){let a=Se();d(0,"button",76),de("click",function(s){U(a);let m=x(2).$implicit;return x(2).onRemove(m.ID),Q(s.stopPropagation())}),v(1," \xD7 "),p()}}function o6(o,c){if(o&1){let a=Se();d(0,"div",69)(1,"img",74),de("click",function(s){U(a);let m=x().$implicit,h=x(2);return Q(h.openBigPicture(m.Image,s))}),p(),k(2,r6,2,0,"button",75),p()}if(o&2){let a=x().$implicit,l=x(2);f(),M("src",a.Image,vl),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.ImageEditor?2:-1)}}function l6(o,c){if(o&1){let a=Se();d(0,"div",77),de("click",function(){U(a);let s=x().$implicit,m=x(2);return Q(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.ImageEditor?m.onAddImageModal(s.ID):null)}),G(1,"i",78),p()}if(o&2){let a=x(3);Kl("cursor",!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.ImageEditor?"pointer":"not-allowed")}}function s6(o,c){if(o&1&&(d(0,"td")(1,"span"),v(2),p()()),o&2){let a=x().$implicit;f(2),Ae(a.Code)}}function c6(o,c){if(o&1&&(d(0,"td")(1,"span"),v(2),p()()),o&2){let a=x().$implicit;f(2),Ae(a.Hexacode)}}function d6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitCost)," ")}}function p6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPrice)," ")}}function m6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPriceMinimum)," ")}}function f6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.PriceDiscount)," ")}}function u6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.Weight)," ")}}function v6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.Inventory)," ")}}function g6(o,c){if(o&1&&(d(0,"td",73),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.RatioDisplay)}}function b6(o,c){if(o&1&&(d(0,"td",73),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.BaseUnitName," ")}}function h6(o,c){if(o&1&&(d(0,"tr")(1,"td",67)(2,"div",68),k(3,o6,3,2,"div",69)(4,l6,2,2,"div",70),d(5,"div",67)(6,"a",71),v(7),p(),d(8,"small",72)(9,"i"),v(10),p()()()()(),k(11,s6,3,1,"td"),k(12,c6,3,1,"td"),k(13,d6,3,3,"td",73),k(14,p6,3,3,"td",73),k(15,m6,3,3,"td",73),k(16,f6,3,3,"td",73),k(17,u6,3,3,"td",73),k(18,v6,3,3,"td",73),k(19,g6,2,1,"td",73),k(20,b6,2,1,"td",73),p()),o&2){let a=c.$implicit,l=x(2);f(),Os(ot(19,T_,a.Discontinued?"line-through":"none")),hr("bg-gradient-warning",a.Discontinued),f(2),D(a.Image&&a.Image.trim()!==""?3:4),f(3),M("routerLink",ft(21,P_))("queryParams",ot(22,lf,a.ID)),f(),oe("",a.Model," "),f(3),Ae(a.VariantType),f(),D(l.variantColumnDisplayService.columnsToDisplay.Code.selected?11:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Hexacode.selected?12:-1),f(),D(l.roleService.product!=null&&l.roleService.product.Cost&&l.variantColumnDisplayService.columnsToDisplay.UnitCost.selected?13:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible&&l.variantColumnDisplayService.columnsToDisplay.UnitPrice.selected?14:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible&&l.variantColumnDisplayService.columnsToDisplay.PriceMin.selected?15:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Percentage.selected?16:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Weight.selected?17:-1),f(),D(l.roleService.inventory!=null&&l.roleService.inventory.View&&l.variantColumnDisplayService.columnsToDisplay.Inventory.selected?18:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Ratio.selected?19:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.ReferenceUnit.selected?20:-1)}}function x6(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",0)(1,"actions"),k(2,N_,9,10,"div",1),d(3,"div",2),k(4,F_,3,5,"a",3),k(5,V_,3,0,"a",4),p()(),d(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"div",13)(16,"div")(17,"div",14)(18,"label"),v(19," Code "),p(),k(20,R_,1,1,"i",15),p()(),k(21,O_,3,0,"div",16),p(),d(22,"div",13)(23,"div")(24,"div",17),v(25),p()(),k(26,U_,3,1,"div",16),p()(),d(27,"div",12)(28,"label",18),v(29,"Category"),p(),d(30,"div",19),de("click",function(){U(a);let s=x();return Q(s.goToCategoryInfo(s.data().Product.CategoryID))}),v(31),p()()(),k(32,Q_,4,4,"div"),p()()()(),d(33,"div",20)(34,"div",8)(35,"div",9)(36,"div",21)(37,"div")(38,"label",18),v(39,"Supplier"),p(),k(40,j_,2,2,"div",22)(41,L_,2,1,"div",23),p(),d(42,"div")(43,"label",18),v(44,"Brand"),p(),d(45,"div",17),v(46),p()(),d(47,"div")(48,"label",18),v(49,"Tags"),p(),d(50,"div",24),k(51,q_,2,0),p()(),d(52,"div")(53,"label",18),v(54,"Status"),p(),d(55,"div",17),v(56),p()()()()()()(),d(57,"div",6)(58,"div",25)(59,"div",26)(60,"div",27)(61,"div",28)(62,"h3",29),v(63,"Pricing & Variants"),p(),d(64,"div",30)(65,"div",31),G(66,"i",32),p(),d(67,"ul",33)(68,"div",34)(69,"h6"),v(70,"Columns to View"),p()(),Jt(71,z_,6,6,"li",35,B_),p()()(),d(73,"div",1),k(74,Y_,2,5,"a",36),p()(),d(75,"div",9)(76,"div",37)(77,"table",38)(78,"thead",39)(79,"tr")(80,"th",40),v(81,"Variant"),p(),k(82,J_,5,2,"th",41),k(83,K_,2,1,"th",42),k(84,X_,2,0,"th",43),k(85,$_,2,0,"th",43),k(86,Z_,2,0,"th",44),k(87,e6,2,0,"th",45),k(88,t6,2,0,"th",46),k(89,i6,2,0,"th",46),k(90,n6,2,0,"th",47),k(91,a6,2,0,"th",48),p()(),d(92,"tbody"),Jt(93,h6,21,24,"tr",null,vi),p()()()()()()(),d(95,"div",13)(96,"div",25)(97,"div",49)(98,"div",9),G(99,"POS-info-product-nav-tab",50),p()()()(),d(100,"div",13)(101,"div",25),G(102,"POS-timeline",51),p()()()()()}if(o&2){let a,l,s,m=x();M("pageData",m.menuData())("hideSearchDropdown",!0)("hideSearchBox",!0)("tooltipTitle",(a=m.data())==null||a.Form==null?null:a.Form.Name),f(2),D(m.roleService.report.View?2:-1),f(2),D(m.roleService.product.Edit?4:-1),f(),D(m.roleService.product.Delete?5:-1),f(11),Jo(m.variantColumnDisplayService.productCodeType()==="code"?"col-12 pe-5":"col-6 pe-2"),f(4),D(m.data().Product.Hexacode?20:-1),f(),D(m.variantColumnDisplayService.productCodeType()==="hexacode"?21:-1),f(2),Jo(m.variantColumnDisplayService.productCodeType()==="code"?"col-12 pe-5":"col-6 pe-2"),f(2),oe(" ",m.data().Product.Code," "),f(),D(m.variantColumnDisplayService.productCodeType()==="hexacode"?26:-1),f(5),oe(" ",m.data().Form.Name," "),f(),D(m.roleService.product.ImageEditor||!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit||(!m.roleService.product.ImageEditor||!(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit))&&m.productImages.length>0?32:-1),f(8),D(m.maskingFields.SupplierName&&!m.roleService.global.SensitiveField?40:41),f(6),oe(" ",m.data().Product.Brand," "),f(5),D(m.data().Form.Tags?51:-1),f(4),hr("text-danger",m.data().Product.Discontinued),f(),oe(" ",m.data().Product.Discontinued?"Discontinued":"Active"," "),f(15),Kt(m.variantColumnDisplayService.getAvailableColumns()),f(3),D(m.roleService.inventory.View?74:-1),f(8),D(m.variantColumnDisplayService.columnsToDisplay.Code.selected?82:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Hexacode.selected?83:-1),f(),D(m.roleService.product!=null&&m.roleService.product.Cost&&m.variantColumnDisplayService.columnsToDisplay.UnitCost.selected?84:-1),f(),D(m.roleService.sell!=null&&m.roleService.sell.PriceVisible&&m.variantColumnDisplayService.columnsToDisplay.UnitPrice.selected?85:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Percentage.selected?86:-1),f(),D(m.roleService.sell!=null&&m.roleService.sell.PriceVisible&&m.variantColumnDisplayService.columnsToDisplay.PriceMin.selected?87:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Weight.selected?88:-1),f(),D(m.roleService.inventory!=null&&m.roleService.inventory.View&&m.variantColumnDisplayService.columnsToDisplay.Inventory.selected?89:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Ratio.selected?90:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.ReferenceUnit.selected?91:-1),f(2),Kt(m.data().Variant),f(6),M("data",m.data()),f(3),M("viewLink",ft(39,I_))("queryParams",ot(40,of,(l=m.data())==null||l.Product==null?null:l.Product.ID))("items",m.timelineData)("created",((s=m.data())==null||s.DocumentInfo==null?null:s.DocumentInfo.Created)??null)}}var _6={Create:"Created",Update:"Updated"},Qd=class o extends Cd{constructor(a,l,s,m,h,_,w,A){super(a,l,"catalog/ProductLoader/ProductInfoInitial",s);this.httpService=l;this.activatedRoute=s;this.router=m;this.toaster=h;this.matDialog=_;this.title=w;this.roleService=A;this.variantColumnDisplayService.resetCodeTypes(),this.destroy$=new ps}httpService;activatedRoute;router;toaster;matDialog;title;roleService;formVariantV2Service=dn(_d);variantColumnDisplayService=dn(dg);maxFile=5;timelineData=[];timelineLoading=!1;bigPicture=dn(vs);destroy$;redirect;productImages=[];ratioConfig;maskingFields;maskingFieldMsg=T2.maskingField;showMainImageOverlay=!0;initRoles(){this.ratioConfig=this.data()?.Variant?.filter(a=>a.TypeID==7).length>0}get isMultipleUOM(){return this.data()?.Product?.VariantTypeID===7}get hasHexacodeVariant(){return(this.data()?.Variant??[]).some(a=>!Qi.IsEmpty(a.Hexacode))}postBindData(){Qi.IsNotEmpty(this.data()?.Product?.Hexacode)&&this.variantColumnDisplayService.resetCodeTypes("hexacode"),this.menuData().H=this.data().PageTitle,this.maskingFields=Qi.generateMaskingField(this.data().MaskFields);let a=this.title.getTitle().split("|")[0],l=this.data().Product.Name;this.title.setTitle(`${a}| ${l}`),this.productImages=this.data().ProductImages,this.initRoles(),this.fetchProductTimeline()}fetchProductTimeline(){let a=this.data()?.Product?.ID;a&&(this.timelineLoading=!0,this.httpService.get(`/API/catalog/Product/timeline/${a}`).subscribe({next:l=>{this.timelineData=Vd(l?.Data,_6),this.timelineLoading=!1},error:()=>{this.timelineData=[],this.timelineLoading=!1}}))}uploadEditedImage(){let a=this.sliceImageUrl(),l={ID:this.data().Product.ID,ImageUrl:this.productImages[0]?this.productImages[0].URL:"",ProductImages:a};this.httpService.post(Da.UpdateProductImage,l).subscribe(s=>{this.toaster.success("Image has been updated",Zi.Success),this.productImages=s.ProductImages})}sliceImageUrl(){return this.productImages.map(a=>{let l="";return a.URL.includes("crop")&&(l=a.URL.split("upload/")[1].split(`/${this.data().CloudinaryConfig}`)[0]+"#"),a.URL=l+a.URL.substring(a.URL.lastIndexOf("/")+1),a})}onRemoveImage(a=-1,l){l?.stopPropagation(),this.matDialog.open(Fd,{data:{message:"Are you sure you want to delete this image?",title:"Confirm Delete"},width:"335px"}).afterClosed().subscribe(s=>{s=="REMOVE"&&(a!=-1&&(this.productImages=this.productImages.filter((m,h)=>h!=a)),this.uploadEditedImage())})}onEditImage(a,l,s){s.stopPropagation();let m=a.split(`/${this.data().CloudinaryConfig}`)[1],h=this.data().CloudinaryConfig+m.split(".")[0],_=`.${m.split(".")[1]}`}uploadPicture(){}removeProduct(){confirm("Are you sure you want to delete this record?")&&(this.redirect=!0,this.data().Form={ID:this.data().Product.ID},this.httpService.post("/API/catalog/product/DeleteProductInfo",this.data().Form).subscribe({next:()=>{let l=`${this.data()?.PageTitle} has been deleted successfully.`;this.onDeleteSuccess(l)}}))}onDeleteSuccess(a){let l;this.redirect?(l=a,this.router.navigate(["/menu/Products/Catalog/Products"])):l="Image success change",this.toaster.success(l,Zi.Success)}drop(a){G2(this.productImages,a.previousContainer.data,a.container.data),this.uploadEditedImage()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}goToCategoryInfo(a){this.maskingFields.Category&&this.roleService.global.SensitiveField||this.router.navigate(["/menu/Products/Catalog/Categories/Info"],{queryParams:{ID:a}})}goToSupplierInfo(a){!(this.maskingFields.SupplierName&&!this.roleService.global.SensitiveField)&&Qi.IsNotEmpty(a)&&this.router.navigate(["/menu/Contacts/Contact/Suppliers/Info/V2"],{queryParams:{ID:a}})}onImagesChange(a){this.productImages=a,this.uploadEditedImage()}openBigPicture(a,l){this.bigPicture.openBiggerPicture(l,a)}onRemove(a){this.data().Variant=this.data().Variant.map(l=>l.ID===a?Fo(kr({},l),{Image:""}):l),this.formVariantV2Service.deleteImage(a).subscribe(l=>{this.toaster.success(l.Message,Zi.Success)})}onAddImageModal(a){console.log("VariantID",a);let l=`${this.data().CloudinaryFolderVariant}/${a}`;this.matDialog.open(Ml,{data:{currentProductImagesLength:0,CloudinaryFolder:l,maxNumberOfFiles:1}}).afterClosed().subscribe(m=>{this.onImageUpdated(m,a),this.data().Variant=this.data().Variant.map(h=>h.ID===a?(console.log("result",m),Fo(kr({},h),{Image:m[0].ImageURL})):h)})}onImageUpdated(a,l){this.formVariantV2Service.updateImage(l,a[0].ImageName).subscribe(s=>{s&&this.toaster.success(s.Message,Zi.Success)})}switchProductCodeType(){this.variantColumnDisplayService.productCodeType.update(a=>a==="code"?"hexacode":"code")}toggleVariantHexacodeColumn(){this.variantColumnDisplayService.toggleColumn("Hexacode")}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(Jn),se(ir),se(zi),se(Ma),se(dc),se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-product"]],standalone:!1,features:[$i],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox","tooltipTitle"],[1,"btn-group"],[1,"btn-group","ms-5"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["role","button",1,"btn","btn-outline-secondary"],[1,"container-fluid","bg-light-gray","pt-8"],[1,"row","mb-10"],[1,"col-md-8","d-flex","flex-column"],[1,"card","h-100","mb-0"],[1,"card-body"],[1,"d-flex","flex-column","gap-10"],[1,"row","g-3"],[1,"col-6"],[1,"row"],[1,"d-flex","gap-2","align-items-center","mb-2"],["matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-hexagon-plus","cursor",3,"matTooltip"],[1,"col-6","pe-6","ps-1"],[1,"form-control","info-display"],[1,"mb-2"],[1,"form-control","info-display","info-display--link",3,"click"],[1,"col-md-4","ps-3","d-flex","flex-column"],[1,"d-flex","flex-column","gap-6"],["matTooltipPosition","below",1,"form-control","info-display",3,"matTooltip"],[1,"form-control","info-display","info-display--link"],[1,"form-control","info-tags"],[1,"col-12"],[1,"card","mb-0"],[1,"card-header","d-flex","justify-content-between"],[1,"d-flex","gap-2","align-items-center"],[1,"mb-0"],[1,"dropdown"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"p-0","d-flex","justify-content-center","align-items-center",2,"cursor","pointer"],["matTooltip","Toggle columns","matTooltipPosition","above",1,"fa-solid","fa-columns-3","position-relative","mb-0","column","column-toggler"],[1,"dropdown-menu","dropdown-menu-start","mt-2"],[1,"border-bottom","pb-3","px-3"],[1,"column-toggle-group"],["role","button","matTooltipPosition","above","matTooltip","Send Delivery",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"table-responsive","horizontal-scroll"],[1,"table","table-bordered"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","200px"],[1,"border-end",2,"width","150px"],[1,"border-end","text-end",2,"width","150px"],[1,"border-end","text-end",2,"width","50px"],[1,"border-end","text-end",2,"width","120px"],[1,"border-end","text-end",2,"width","100px"],[1,"border-end",2,"width","25px"],[1,"border-end",2,"width","140px"],[1,"card"],[3,"data"],["variant","compact",3,"viewLink","queryParams","items","created"],["role","button",1,"btn","btn-outline-secondary","border-end-0",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-chart-bar"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],["role","button",1,"dropdown-item",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],["matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-hexagon-plus","cursor",3,"click","matTooltip"],[3,"imagesChange","images","maxFile","cloudinaryFolder","productID"],["matTooltipPosition","below",1,"bg-secondary",3,"matTooltip"],["matTooltipPosition","above",1,"p-4",3,"click"],[1,"me-3",3,"ngModelChange","onChange","ngModel","binary","inputId"],[1,"cursor-pointer",2,"width","70%",3,"for"],[1,"text-danger","ms-3"],[1,"d-flex","flex-column"],[1,"d-flex","gap-3"],[1,"position-relative","thumbnail-image-wrapper"],[1,"d-flex","justify-content-center","align-items-center","image-uploader",3,"cursor"],[3,"routerLink","queryParams"],[2,"line-height","1"],[1,"text-end"],["brokenImageIconFailSafe","",2,"width","41.33px","cursor","pointer","object-fit","cover",3,"click","src"],["type","button","aria-label","Remove image",1,"thumbnail-remove-btn"],["type","button","aria-label","Remove image",1,"thumbnail-remove-btn",3,"click"],[1,"d-flex","justify-content-center","align-items-center","image-uploader",3,"click"],[1,"fa-light","fa-image-circle-plus",2,"color","#9ca3af"]],template:function(l,s){if(l&1&&k(0,x6,103,42,"mainpanel-cmp",0),l&2){let m;D((m=s.data())!=null&&m.Product?0:-1)}},dependencies:[gs,Ei,tn,li,Vi,Ri,X2,kl,wc,Ud,Li,Vn],styles:["@media(min-width:992px){.product-info-row[_ngcontent-%COMP%]{height:467.6px}}label[_ngcontent-%COMP%]{font-size:.813rem}.info-display[_ngcontent-%COMP%]{height:2.375rem;padding:.375rem .75rem;font-size:.75rem;border:1px solid #dee2e6;border-radius:.25rem;background:#fff;color:#495057;display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.info-display--link[_ngcontent-%COMP%]{color:#0976b4;cursor:pointer}.info-tags[_ngcontent-%COMP%]{min-height:2.375rem;height:auto;padding:.375rem .75rem;font-size:.75rem;border:1px solid #dee2e6;border-radius:.25rem;background:#fff;display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px;overflow-y:auto;max-height:50vh}.column-toggler[_ngcontent-%COMP%]{cursor:pointer}.horizontal-scroll[_ngcontent-%COMP%]{overflow-x:auto;overflow-y:hidden}.horizontal-scroll[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{min-width:max-content}.thumbnail-image-wrapper[_ngcontent-%COMP%] .thumbnail-remove-btn[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;border:none;background:#dc2626d9;color:#fff;font-size:.75rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s}.thumbnail-image-wrapper[_ngcontent-%COMP%]:hover .thumbnail-remove-btn[_ngcontent-%COMP%]{opacity:1}.image-uploader[_ngcontent-%COMP%]{width:41.33px;height:41.33px;cursor:pointer;background-color:#fafafa;border:1.5px dashed #d1d5db;border-radius:4px}"]})};var C6=()=>["/menu/Products/Log/Variant_History"],y6=()=>["Form"],w6=o=>({"text-decoration-line-through":o}),Mg=()=>["/menu/Products/Catalog/Variants/Info"],Eg=o=>({ID:o}),Tg=o=>({width:o});function A6(o,c){if(o&1){let a=Se();d(0,"a",11),de("click",function(){U(a);let s=x(2);return Q(s.httpPostListID("catalog/variant/DeleteVariantList"))}),G(1,"i",12),v(2," Delete "),p()}}function S6(o,c){o&1&&(d(0,"a",4),G(1,"i",13),v(2," Update History "),p()),o&2&&M("routerLink",ft(1,C6))}function I6(o,c){if(o&1){let a=Se();d(0,"button",14),de("click",function(){U(a);let s=x(2);return Q(s.openExportModal())}),G(1,"i",15),v(2," Export "),p()}}function k6(o,c){o&1&&(d(0,"a",6),v(1," Add "),p()),o&2&&M("routerLink",ft(1,y6))}function D6(o,c){if(o&1&&(d(0,"div",28)(1,"span",29),v(2),p(),d(3,"span",30),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function M6(o,c){if(o&1&&(d(0,"div",28)(1,"span",29),v(2),p(),d(3,"span",30),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function E6(o,c){if(o&1){let a=Se();d(0,"div",16)(1,"div",17)(2,"h6"),v(3,"Category"),p(),d(4,"POS-product-category-select",18),je("selectedCategoryIDChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.CategoryID,s)||(m.pageData().Filter.CategoryID=s),Q(s)}),p()(),d(5,"div",17)(6,"h6"),v(7,"Supplier"),p(),d(8,"autocompleteV2",19),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.SupplierID,s)||(m.pageData().Filter.SupplierID=s),Q(s)}),p()(),d(9,"div",17)(10,"h6"),v(11,"Brand"),p(),d(12,"POS-brand-options-v2",20),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.BrandIDs,s)||(m.pageData().Filter.BrandIDs=s),Q(s)}),p()(),d(13,"div",17)(14,"h6"),v(15,"Type"),p(),d(16,"ng-select",21),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.TypeID,s)||(m.pageData().Filter.TypeID=s),Q(s)}),p()(),d(17,"div",17)(18,"h6"),v(19,"Cost Currency"),p(),d(20,"ng-select",21),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.VariantCostCurrencyID,s)||(m.pageData().Filter.VariantCostCurrencyID=s),Q(s)}),_i(21,D6,5,2,"ng-template",22)(22,M6,5,2,"ng-template",23),p()(),d(23,"div",17)(24,"h6"),v(25,"Outlet Inventory"),p(),d(26,"outlet-selector",24),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.EntityID,s)||(m.pageData().Filter.EntityID=s),Q(s)}),p()(),d(27,"div",17)(28,"h6"),v(29,"Discontinued"),p(),d(30,"radio-options",25),je("modelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.Discontinued,s)||(m.pageData().Filter.Discontinued=s),Q(s)}),p()(),d(31,"div",17)(32,"h6"),v(33,"Order By"),p(),d(34,"radio-options",26),je("modelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.OrderBy,s)||(m.pageData().Filter.OrderBy=s),Q(s)}),p()(),d(35,"div",17)(36,"h6"),v(37,"Order Direction"),p(),d(38,"radio-options",27),je("modelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.OrderByDirection,s)||(m.pageData().Filter.OrderByDirection=s),Q(s)}),p()()()}if(o&2){let a,l,s=x(2);f(4),Le("selectedCategoryID",s.pageData().Filter.CategoryID),M("showClear",!0),f(4),Le("ngModel",s.pageData().Filter.SupplierID),f(4),Le("ngModel",s.pageData().Filter.BrandIDs),M("multiple",!0)("placeholder","Choose Brand")("clearable",!0),f(4),M("items",(a=s.pageData().Options)==null?null:a.Types),Le("ngModel",s.pageData().Filter.TypeID),f(4),M("items",(l=s.pageData().Options)==null?null:l.CurrencyOptions),Le("ngModel",s.pageData().Filter.VariantCostCurrencyID),f(6),M("multiple",!1)("accessType",2),Le("ngModel",s.pageData().Filter.EntityID),f(4),M("options",s.discontinuedOption()),Le("model",s.pageData().Filter.Discontinued),f(4),M("options",s.pageData().Options.OrderByOptions),Le("model",s.pageData().Filter.OrderBy),f(4),M("options",s.pageData().Options.OrderByDirectionOptions),Le("model",s.pageData().Filter.OrderByDirection)}}function T6(o,c){if(o&1){let a=Se();d(0,"th",34)(1,"input",43),de("change",function(s){U(a);let m=x(3);return Q(m.onSelectAllData(s.target.checked))}),p()()}}function P6(o,c){o&1&&(d(0,"th",36),v(1,"Type"),p())}function B6(o,c){o&1&&(d(0,"th",36),v(1,"Code"),p())}function N6(o,c){o&1&&(d(0,"th",37),v(1,"Description"),p())}function F6(o,c){o&1&&(d(0,"th",38),v(1,"Buying Cost"),p())}function V6(o,c){o&1&&(d(0,"th",38),v(1,"Last Buy Cost"),p())}function R6(o,c){o&1&&(d(0,"th",39),v(1," Selling Price "),p())}function O6(o,c){o&1&&(d(0,"th",40),v(1,"%"),p())}function U6(o,c){o&1&&(d(0,"th",41),v(1," Inventory "),p())}function Q6(o,c){if(o&1){let a=Se();d(0,"td",34)(1,"input",53),je("ngModelChange",function(s){U(a);let m=x().$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),p()()}if(o&2){let a=x().$implicit;f(),Le("ngModel",a.selected)}}function j6(o,c){if(o&1){let a=Se();d(0,"img",54),de("click",function(s){U(a);let m=x().$implicit,h=x(3);return Q(h.openBiggerPicture(m,s))}),p()}if(o&2){let a=x().$implicit,l=x(3);Os(ot(5,Tg,l.data().ThumbnailWidth+"px")),M("src",a.ThumbnailUrl,vl)("linkTarget",l.pageData().LinkTarget)("redirectUrl","/menu/Products/Catalog/Variants/Info/?ID="+a.ID)}}function L6(o,c){if(o&1&&(d(0,"a",47),G(1,"img",55),p()),o&2){let a=x().$implicit,l=x(3);M("routerLink",ft(5,Mg))("queryParams",ot(6,Eg,a.ID))("target",l.pageData().LinkTarget),f(),Os(ot(8,Tg,l.data().ThumbnailWidth+"px"))}}function H6(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.TypeLabel," ")}}function q6(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.Code)}}function G6(o,c){if(o&1&&G(0,"td",50),o&2){let a=x().$implicit;M("innerHTML",a.Description,W1)}}function z6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitCost)," ")}}function Y6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.OrderPrice)," ")}}function W6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPrice)," ")}}function J6(o,c){if(o&1&&(d(0,"td",52),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.PriceDiscount!=0?a.PriceDiscount:""," ")}}function K6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"quantityFraction"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.OnHand)," ")}}function X6(o,c){if(o&1&&(d(0,"tr"),k(1,Q6,2,1,"td",34),d(2,"td")(3,"div",44)(4,"div",45),k(5,j6,1,7,"img",46),zl(6),k(7,L6,2,10,"a",47),Yl(),p(),d(8,"div",48)(9,"a",49),v(10),p()()()(),k(11,H6,2,1,"td"),k(12,q6,2,1,"td"),k(13,G6,1,1,"td",50),k(14,z6,3,3,"td",51),k(15,Y6,3,3,"td",51),k(16,W6,3,3,"td",51),k(17,J6,2,1,"td",52),k(18,K6,3,3,"td",51),p()),o&2){let a,l=c.$implicit,s=x(3);f(),D(s.roleService.product!=null&&s.roleService.product.Delete?1:-1),f(4),D(l.ImageUrl?5:-1),f(2),D(l.ImageUrl?-1:7),f(2),Jo(ot(17,w6,(l==null?null:l.IsDiscontinued)&&s.pageData().Filter.Discontinued==2)),M("routerLink",ft(19,Mg))("queryParams",ot(20,Eg,l.ID))("target",s.pageData().LinkTarget),f(),Ae(l.Name),f(),D(s.column().Type.selected?11:-1),f(),D(s.column().Code.selected?12:-1),f(),D(s.column().Description.selected?13:-1),f(),D(s.roleService.product!=null&&s.roleService.product.Cost&&s.column().BuyingCost.selected?14:-1),f(),D(s.roleService.product!=null&&s.roleService.product.Cost&&s.column().LastBuyCost.selected?15:-1),f(),D(s.roleService.sell!=null&&s.roleService.sell.PriceVisible&&s.column().SellingPrice.selected?16:-1),f(),D(s.roleService.sell!=null&&s.roleService.sell.Discount&&s.column().Discount.selected?17:-1),f(),D(s.roleService.inventory!=null&&s.roleService.inventory.View&&((a=s.column().Inventory)!=null&&a.selected)?18:-1)}}function $6(o,c){if(o&1){let a=Se();d(0,"table",31),de("matSortChange",function(s){U(a);let m=x(2);return Q(m.sortData(s))}),d(1,"thead",32)(2,"tr",33),k(3,T6,2,0,"th",34),d(4,"th",35),v(5,"Name"),p(),k(6,P6,2,0,"th",36),k(7,B6,2,0,"th",36),k(8,N6,2,0,"th",37),k(9,F6,2,0,"th",38),k(10,V6,2,0,"th",38),k(11,R6,2,0,"th",39),k(12,O6,2,0,"th",40),k(13,U6,2,0,"th",41),p()(),d(14,"tbody"),_i(15,X6,19,22,"tr",42),p()()}if(o&2){let a,l=x(2);f(3),D(l.roleService.product!=null&&l.roleService.product.Delete?3:-1),f(3),D(l.column().Type.selected?6:-1),f(),D(l.column().Code.selected?7:-1),f(),D(l.column().Description.selected?8:-1),f(),D(l.roleService.product!=null&&l.roleService.product.Cost&&l.column().BuyingCost.selected?9:-1),f(),D(l.roleService.product!=null&&l.roleService.product.Cost&&l.column().LastBuyCost.selected?10:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible&&l.column().SellingPrice.selected?11:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.Discount&&l.column().Discount.selected?12:-1),f(),D(l.roleService.inventory!=null&&l.roleService.inventory.View&&((a=l.column().Inventory)!=null&&a.selected)?13:-1),f(2),M("ngForOf",l.infiniteList)}}function Z6(o,c){if(o&1){let a=Se();d(0,"infinite-pagination",56),de("nextPage",function(){U(a);let s=x(2);return Q(s.NextPage(!0))})("fetchTotalData",function(){U(a);let s=x(2);return Q(s.StoreRowsCountAPIResult("catalog/variant/GetVariantListCount"))})("concatAllData",function(){U(a);let s=x(2);return Q(s.StoreRowsCountAPIResult("catalog/variant/GetVariantListCount",!0))}),p()}if(o&2){let a=x(2);M("totalData",a.listTotal())("totalCurrentRow",a.infiniteList==null?null:a.infiniteList.length)("pageNumber",a.pageData().Filter.PageNumber)("nextPageDisabled",a.nextPageDisabled())("isFetchTotalData",a.pageData().HideStoreApiCount)("goToLast",a.goToLast())("hasShowAllButton",!1)}}function e5(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",2),je("textChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.Text,s)||(m.pageData().Filter.Text=s),Q(s)}),de("onSubmit",function(){U(a);let s=x();return Q(s.searchFromPageOne())}),je("filterChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter,s)||(m.pageData().Filter=s),Q(s)}),de("onChangeColumnCheckbox",function(){U(a);let s=x();return Q(s.checkForAdvancedColumn())}),d(1,"actions"),k(2,A6,3,0,"a",3),k(3,S6,3,2,"a",4),k(4,I6,3,0,"button",5),k(5,k6,2,2,"a",6),p(),d(6,"filters"),_i(7,E6,39,20,"ng-template",null,0,co),p(),d(9,"content")(10,"div",7)(11,"div",8),k(12,$6,16,10,"table",9),p(),k(13,Z6,1,7,"infinite-pagination",10),p()()()}if(o&2){let a=x();M("pageData",a.menuData()),Le("text",a.pageData().Filter.Text),M("isFilterOnDropdown",!1),Le("filter",a.pageData().Filter),M("column",a.column()),f(2),D(a.roleService.product.Delete&&a.getSelectedData().length>0?2:-1),f(),D(a.roleService.product!=null&&a.roleService.product.Edit?3:-1),f(),D(a.roleService.global!=null&&a.roleService.global.Export?4:-1),f(),D(a.roleService.product!=null&&a.roleService.product.Create?5:-1),f(7),D(a.data()?12:-1),f(),D(a.infiniteList.length>0?13:-1)}}var jd=class o extends fs{constructor(a,l,s,m,h,_){super(a,l,"catalog/variant/GetVariantList","catalog/VariantLoader/VariantList",s);this.httpService=l;this.csvConverter=m;this.roleService=h;this.matDialog=_}httpService;csvConverter;roleService;matDialog;columnService=dn(ld);bigPicture=dn(vs);column=Qe({Type:{selected:!0},Code:{selected:!0},Description:{selected:!1},BuyingCost:{selected:!0,name:"Buying Cost"},LastBuyCost:{selected:!1,name:"Last Buy Cost"},SellingPrice:{selected:!0,name:"Selling Price"},Discount:{selected:!1,name:"%"},Inventory:{selected:!0}});discontinuedOption=Qe([{Key:0,Value:"No"},{Key:1,Value:"Yes"},{Key:2,Value:"All"}]);more=Qe(!1);options=Qe([{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}]);isHasBrandRestriction=H1(()=>!!this.pageData().Filter.BrandIDs&&this.pageData().Filter.BrandIDs.length>0&&!this.brandIdSelectedChange());brandIdSelectedChange=Qe(!1);openExportModal(){this.matDialog.open(Kr,{data:{title:"Variant",exportTypes:[{ID:"ProductExport/VariantExport",Value:"Default",FileName:"Variant"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!0}})}sortData(a){let l=JSON.parse(JSON.stringify(this.originalData()));if(!a.active||a.direction===""){this.infiniteList=l;return}this.infiniteList=l.sort((s,m)=>{let h=a.direction==="asc";switch(a.active){case"Name":return Qi.compare(s.Name.toLocaleLowerCase(),m.Name.toLocaleLowerCase(),h);case"Price":return Qi.compare(s.UnitPrice,m.UnitPrice,h);case"Inventory":return Qi.compare(s.OnHand,m.OnHand,h);default:return 0}})}openBiggerPicture(a,l){this.bigPicture.openBiggerPicture(l,a.ImageUrl)}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column(),this.infiniteList,this.pageData().Filter)}onFilterBrand(a){this.pageData().Filter.BrandIDs=a,this.brandIdSelectedChange.set(!0)}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(zi),se(Z1),se(yi),se(Ma))};static \u0275cmp=nt({type:o,selectors:[["POS-variant"]],standalone:!1,features:[$i],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","text","isFilterOnDropdown","filter","column"],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["role","button","confirm-message","Are you sure you want to delete this record?",1,"btn","btn-outline-secondary","me-3"],["role","button",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","Add",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom"],[3,"totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast","hasShowAllButton"],["role","button","confirm-message","Are you sure you want to delete this record?",1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-trash"],["aria-hidden","true",1,"fa","fa-clock-rotate-left","me-2"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter","mt-3",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel","multiple","placeholder","clearable"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],["name","Discontinued",3,"modelChange","options","model"],["name","OrderBy",3,"modelChange","options","model"],["name","OrderDirection",3,"modelChange","options","model"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","14px"],["mat-sort-header","Name"],[2,"width","100px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["mat-sort-header","Price","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","50px"],["mat-sort-header","Inventory","arrowPosition","before",2,"width","85px"],[4,"ngFor","ngForOf"],["type","checkbox",3,"change"],[1,"d-flex","flex-row"],[2,"cursor","pointer"],["matTooltipPosition","above","matTooltip","Click to zoom","brokenImageIconFailSafe","",3,"src","style","linkTarget","redirectUrl"],[1,"d-block",3,"routerLink","queryParams","target"],[1,"ps-2","name-wrapper"],[1,"align-top",3,"routerLink","queryParams","target"],[3,"innerHTML"],[1,"text-end"],[1,"text-end",2,"color","red"],["type","checkbox",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom","brokenImageIconFailSafe","",3,"click","src","linkTarget","redirectUrl"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast","hasShowAllButton"]],template:function(l,s){l&1&&k(0,e5,14,11,"mainpanel-cmp",1),l&2&&D(s.pageData()&&s.data()?0:-1)},dependencies:[Ei,tn,D2,li,A1,Vi,Ri,$o,S1,I1,Co,Il,k1,Zo,tl,kl,Y2,W2,xc,Li,J2],styles:[".break-word[_ngcontent-%COMP%]{overflow-wrap:break-word;word-wrap:break-word}.category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}@media(max-width:575.98px){.table-responsive[_ngcontent-%COMP%]{font-size:.8rem}.table-responsive[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{min-width:640px}.table-responsive[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-responsive[_ngcontent-%COMP%] .name-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center}}"]})};var Ld=(l=>(l[l.PurchaseOrder=2]="PurchaseOrder",l[l.Archive=3]="Archive",l[l.LandedCost=6]="LandedCost",l))(Ld||{});var Pg=()=>["/menu/Products/Catalog/Variants/Info"],cf=o=>({ID:o}),t5=()=>["/menu/Products/Catalog/Variants"],i5=o=>[o];function n5(o,c){if(o&1){let a=Se();d(0,"button",11),de("click",function(){U(a);let s=x(2);return Q(s.openExportModal())}),G(1,"i",12),v(2," Export "),p()}}function a5(o,c){if(o&1&&(d(0,"a",4),v(1," Return to Variant "),p()),o&2){let a=x(2);M("routerLink",ft(2,Pg))("queryParams",ot(3,cf,a.data.Data[0]==null?null:a.data.Data[0].ParentID))}}function r5(o,c){o&1&&(d(0,"a",5),v(1," Return to Variant "),p()),o&2&&M("routerLink",ft(1,t5))}function o5(o,c){if(o&1){let a=Se();d(0,"div",13)(1,"div",14)(2,"h6"),v(3,"Outlet"),p(),d(4,"outlet-selector",15),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.EntityID,s)||(m.pageData.Filter.EntityID=s),Q(s)}),p()(),d(5,"div",14)(6,"h6"),v(7,"Variant"),p(),d(8,"autocompleteV2",16),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.VariantID,s)||(m.pageData.Filter.VariantID=s),Q(s)}),p()(),d(9,"div",14)(10,"h6"),v(11,"From Date"),p(),d(12,"datepicker",17),je("dateChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.From,s)||(m.pageData.Filter.From=s),Q(s)}),p()(),d(13,"div",14)(14,"h6"),v(15,"To Date"),p(),d(16,"datepicker",18),je("dateChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.To,s)||(m.pageData.Filter.To=s),Q(s)}),p()(),d(17,"div",14)(18,"h6"),v(19,"Note"),p(),d(20,"input",19),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.Note,s)||(m.pageData.Filter.Note=s),Q(s)}),p()(),d(21,"div",14)(22,"h6"),v(23,"Page Size"),p(),d(24,"input",20),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.RowCount,s)||(m.pageData.Filter.RowCount=s),Q(s)}),p()()()}if(o&2){let a=x(2);f(4),M("accessType",2),Le("ngModel",a.pageData.Filter.EntityID),M("multiple",!1),f(4),Le("ngModel",a.pageData.Filter.VariantID),M("inputTextValue",a.variantName)("displayText",a.variantName)("renderThumbnail",!0),f(4),Le("date",a.pageData.Filter.From),f(4),Le("date",a.pageData.Filter.To),f(4),Le("ngModel",a.pageData.Filter.Note),f(4),M("max",1e4),Le("ngModel",a.pageData.Filter.RowCount)}}function l5(o,c){o&1&&(d(0,"th"),v(1,"Modified"),p())}function s5(o,c){o&1&&(d(0,"th"),v(1,"Modify By"),p())}function c5(o,c){o&1&&(d(0,"th"),v(1,"Note"),p())}function d5(o,c){o&1&&(d(0,"th"),v(1,"Code"),p())}function p5(o,c){o&1&&(d(0,"th",22),v(1,"Landed Cost"),p())}function m5(o,c){o&1&&(d(0,"th",23),v(1,"Buying Cost"),p())}function f5(o,c){o&1&&(d(0,"th",24),v(1,"Selling Price"),p())}function u5(o,c){o&1&&(d(0,"th"),v(1,"Outlet"),p())}function v5(o,c){o&1&&(d(0,"th"),v(1,"Reference"),p())}function g5(o,c){if(o&1&&(d(0,"td"),v(1),F(2,"date"),p()),o&2){let a=x().$implicit;f(),Ae(Ie(2,1,a.Created,"dd MMM yyyy HH:mm"))}}function b5(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.UserName)}}function h5(o,c){if(o&1&&(G(0,"td",27),F(1,"newlines")),o&2){let a=x().$implicit;M("innerHTML",Ce(1,1,a.Note),W1)}}function x5(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.Code)}}function _5(o,c){if(o&1&&(d(0,"td",22),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),Ae(Ce(2,1,a.LandedCost))}}function C5(o,c){if(o&1&&(d(0,"td",22),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ie(2,1,a.UnitCost,"1.0-4")," ")}}function y5(o,c){if(o&1&&(d(0,"td",22),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ie(2,1,a.UnitPrice,"1.0-4")," ")}}function w5(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.EntityName)}}function A5(o,c){if(o&1&&(d(0,"a",28),v(1),p()),o&2){let a=x(2).$implicit,l=x(3);M("routerLink",ot(3,i5,l.linkReference(a.TypeID)))("queryParams",ot(5,cf,a.ReferenceID)),f(),oe(" ",a.DisplayReference," ")}}function S5(o,c){if(o&1&&v(0),o&2){let a=x(2).$implicit;oe(" ",a.DisplayReference," ")}}function I5(o,c){if(o&1&&(d(0,"td"),k(1,A5,2,7,"a",28)(2,S5,1,1),p()),o&2){let a=x().$implicit,l=x(3);f(),D(a.ReferenceID&&l.isValidTypeID(a.TypeID)?1:2)}}function k5(o,c){if(o&1&&(d(0,"tr",25)(1,"td")(2,"a",26),v(3),p()(),k(4,g5,3,4,"td"),k(5,b5,2,1,"td"),k(6,h5,2,3,"td",27),k(7,x5,2,1,"td"),k(8,_5,3,3,"td",22),k(9,C5,3,4,"td",22),k(10,y5,3,4,"td",22),k(11,w5,2,1,"td"),k(12,I5,3,1,"td"),p()),o&2){let a=c.$implicit,l=x(3);f(2),M("routerLink",ft(12,Pg))("queryParams",ot(13,cf,a.ParentID)),f(),Ae(a.VariantName),f(),D(l.column.Modified.selected?4:-1),f(),D(l.column.ModifyBy.selected?5:-1),f(),D(l.column.Note.selected?6:-1),f(),D(l.column.Code.selected?7:-1),f(),D(l.column.LandedCost.selected?8:-1),f(),D(l.roleService.product.Cost&&l.column.BuyingCost.selected?9:-1),f(),D(l.roleService.sell.UnitPriceEditor&&l.column.SellingPrice.selected?10:-1),f(),D(l.column.Outlet.selected?11:-1),f(),D(l.column.Reference.selected?12:-1)}}function D5(o,c){if(o&1&&(d(0,"table",8)(1,"thead",21)(2,"tr")(3,"th"),v(4,"Variant"),p(),k(5,l5,2,0,"th"),k(6,s5,2,0,"th"),k(7,c5,2,0,"th"),k(8,d5,2,0,"th"),k(9,p5,2,0,"th",22),k(10,m5,2,0,"th",23),k(11,f5,2,0,"th",24),k(12,u5,2,0,"th"),k(13,v5,2,0,"th"),p()(),d(14,"tbody"),Jt(15,k5,13,15,"tr",25,vi),p()()),o&2){let a=x(2);f(5),D(a.column.Modified.selected?5:-1),f(),D(a.column.ModifyBy.selected?6:-1),f(),D(a.column.Note.selected?7:-1),f(),D(a.column.Code.selected?8:-1),f(),D(a.column.LandedCost.selected?9:-1),f(),D(a.roleService.product.Cost&&a.column.BuyingCost.selected?10:-1),f(),D(a.roleService.sell.UnitPriceEditor&&a.column.SellingPrice.selected?11:-1),f(),D(a.column.Outlet.selected?12:-1),f(),D(a.column.Reference.selected?13:-1),f(2),Kt(a.data.Data)}}function M5(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",2),je("textChange",function(s){U(a);let m=x();return Oe(m.pageData.Filter.UserName,s)||(m.pageData.Filter.UserName=s),Q(s)}),de("onSubmit",function(){U(a);let s=x();return Q(s.searchFromPageOne())}),je("filterChange",function(s){U(a);let m=x();return Oe(m.pageData.Filter,s)||(m.pageData.Filter=s),Q(s)}),de("onChangeColumnCheckbox",function(){U(a);let s=x();return Q(s.checkForAdvancedColumn())}),d(1,"actions"),k(2,n5,3,0,"button",3),k(3,a5,2,5,"a",4)(4,r5,2,2,"a",5),p(),d(5,"filters"),_i(6,o5,25,12,"ng-template",null,0,co),p(),d(8,"content")(9,"div",6)(10,"div",7),k(11,D5,17,9,"table",8),p(),d(12,"div",9)(13,"POS-complex-pagination",10),de("jumpToPage",function(){U(a);let s=x();return Q(s.getListData())})("previousPage",function(){U(a);let s=x();return Q(s.getListData())})("nextPage",function(){U(a);let s=x();return Q(s.getListData())}),p()()()()()}if(o&2){let a=x();M("pageData",a.menuData)("hideSearchBox",!0),Le("text",a.pageData.Filter.UserName),M("isFilterOnDropdown",!1),Le("filter",a.pageData.Filter),M("column",a.column),f(2),D(a.roleService.global.Export?2:-1),f(),D(a.pageData.Filter.VariantID?3:4),f(8),D(a.pageData?11:-1),f(2),M("total",a.data.Data.length)("pageData",a.pageData)}}var Hd=class o extends gc{constructor(a,l,s,m,h,_,w){super(s,m,"catalog/variant/VariantHistoryList","catalog/VariantLoader/VariantHistoryLoader",h,l);this.csvConverter=a;this.activatedRoute=l;this.httpService=m;this.roleService=_;this.matDialog=w;this.urlParams=this.activatedRoute.snapshot.queryParams}csvConverter;activatedRoute;httpService;roleService;matDialog;variantName;urlParams;typeId=Ld;columnService=dn(ld);column={Modified:{selected:!0,name:"Modified"},ModifyBy:{selected:!0,name:"Modify By"},Note:{selected:!0,name:"Note"},Code:{selected:!1,name:"Code"},LandedCost:{selected:!1,name:"Landed Cost"},BuyingCost:{selected:!0,name:"Buying Cost"},SellingPrice:{selected:!0,name:"Selling Price"},Outlet:{selected:!1,name:"Outlet"},Reference:{selected:!0,name:"Reference"}};onExportToCsv(){this.convertToCSV(this.csvConverter,this.data.Data,"Variant_Update_History")}postInit(a){this.menuData.H=a.PageTitle,Object.entries(this.urlParams).length>0&&(this.variantName=this.pageData.VariantName);let l=this.data.Data.map(s=>{let m=s.Note.replace(/"/g,'""');return s=Fo(kr({},s),{Note:m}),s});this.data.Data=l}preInitList(){Object.entries(this.urlParams).length>0&&(this.pageData.Filter=Object.assign(this.pageData.Filter,this.urlParams))}isValidTypeID(a){return Object.values(Ld).includes(a)}linkReference(a){let l="";switch(a){case 2:l="/menu/Orders/Order/Purchase_Order/Info";break;case 3:l="/menu/Manufacture/Job_Order/Archive/Info";break;case 6:l="/menu/Orders/Order/Purchase_Order/Info";break;default:break}return l}openExportModal(){this.matDialog.open(Kr,{data:{title:"Variant History",exportTypes:[{ID:"ProductExport/VariantUpdateHistoryExport",Value:"Default",FileName:"Variant History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data?.Data,this.pageData?.Filter)}static \u0275fac=function(l){return new(l||o)(se(Z1),se(Jn),se(en),se(ki),se(zi),se(yi),se(Ma))};static \u0275cmp=nt({type:o,selectors:[["POS-history-variant"]],standalone:!1,features:[$i],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","hideSearchBox","text","isFilterOnDropdown","filter","column"],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","Return to Variant",1,"btn","btn-success",3,"routerLink","queryParams"],["role","button","matTooltipPosition","above","matTooltip","Return to Variant",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"d-sm-block","mt-2"],["api","catalog/variant/VariantHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose an outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue","displayText","renderThumbnail"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"text-end",2,"width","78px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"]],template:function(l,s){l&1&&k(0,M5,14,11,"mainpanel-cmp",1),l&2&&D(s.data?0:-1)},dependencies:[Ei,tn,li,Cn,Vi,Ri,Xr,_o,Il,us,Zo,Li,Vn,Ov],encapsulation:2})};var E5=()=>["/menu/Products/Catalog/Variants/Info"],T5=o=>({ID:o});function P5(o,c){if(o&1){let a=Se();d(0,"button",19),de("click",function(){U(a);let s=x(3);return Q(s.onErase(s.pageData().Filter.EntityID,s.pageData().Filter.CategoryID))}),G(1,"i",20),v(2," Erase "),p()}}function B5(o,c){if(o&1){let a=Se();d(0,"div",3)(1,"button",16),de("click",function(){U(a);let s=x(2);return Q(s.deleteRowCustomOutlet())}),G(2,"i",17),v(3,"Delete "),p(),k(4,P5,3,0,"button",18),p()}if(o&2){let a=x(2);f(4),D(a.roleService.product.DeleteAllOutletPrice?4:-1)}}function N5(o,c){if(o&1){let a=Se();d(0,"button",22),de("click",function(){U(a);let s=x(3);return Q(s.deleteRowCustomOutlet())}),G(1,"i",17),v(2,"Delete "),p()}}function F5(o,c){if(o&1&&k(0,N5,3,0,"button",21),o&2){let a=x(2);D(a.getSelectedData().length>0?0:-1)}}function V5(o,c){if(o&1){let a=Se();d(0,"button",23),de("click",function(){U(a);let s=x(2);return Q(s.openExportModal())}),G(1,"i",24),v(2," Export "),p()}}function R5(o,c){if(o&1){let a=Se();d(0,"div",25)(1,"h6"),v(2,"Outlet"),p(),d(3,"ng-select",26),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.EntityID,s)||(m.pageData().Filter.EntityID=s),Q(s)}),p(),d(4,"h6"),v(5,"Category"),p(),d(6,"POS-product-category-select",27),je("selectedCategoryIDChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.CategoryID,s)||(m.pageData().Filter.CategoryID=s),Q(s)}),p()()}if(o&2){let a=x(2);f(3),M("items",a.pageData().Options.Entities),Le("ngModel",a.pageData().Filter.EntityID),f(3),Le("selectedCategoryID",a.pageData().Filter.CategoryID),M("showClear",!0)}}function O5(o,c){if(o&1){let a=Se();d(0,"th",10)(1,"input",28),de("change",function(s){U(a);let m=x(2);return Q(m.onSelectAllData(s.target.checked))}),p()()}if(o&2){let a,l=x(2);f(),M("checked",l.getSelectedData().length==((a=l.data().Data)==null?null:a.length)&&((a=l.data().Data)==null?null:a.length)>0)}}function U5(o,c){o&1&&(d(0,"th",11),v(1,"Unit Cost"),p())}function Q5(o,c){o&1&&(d(0,"th",11),v(1,"Extra Cost"),p())}function j5(o,c){if(o&1){let a=Se();d(0,"td")(1,"input",30),je("ngModelChange",function(s){U(a);let m=x().$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),p()()}if(o&2){let a=x().$implicit;f(),Le("ngModel",a.selected)}}function L5(o,c){if(o&1&&(d(0,"td",11),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitCost)," ")}}function H5(o,c){if(o&1&&(d(0,"td",11),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.ExtraCost)," ")}}function q5(o,c){if(o&1&&(d(0,"tr",12),k(1,j5,2,1,"td"),d(2,"td"),v(3),p(),d(4,"td"),v(5),p(),d(6,"td")(7,"a",29),v(8),p()(),d(9,"td"),v(10),p(),k(11,L5,3,3,"td",11),d(12,"td",11),v(13),F(14,"number"),p(),k(15,H5,3,3,"td",11),d(16,"td",11),v(17),F(18,"number"),p(),d(19,"td",11),v(20),F(21,"number"),p()()),o&2){let a=c.$implicit,l=x(2);f(),D(l.roleService.product.Delete?1:-1),f(2),Ae(a.Name),f(2),Ae(a.CategoryName),f(2),M("routerLink",ft(18,E5))("queryParams",ot(19,T5,a.VariantID)),f(),Ae(a.VariantName),f(2),Ae(a.VariantCode),f(),D(l.roleService.product.Cost?11:-1),f(2),Ae(Ce(14,12,a.UnitPrice)),f(2),D(l.roleService.product.Cost?15:-1),f(2),Ae(Ce(18,14,a.OutletPrice)),f(3),Ae(Ce(21,16,a.PriceDiscount))}}function G5(o,c){if(o&1){let a=Se();d(0,"POS-complex-pagination",31),de("jumpToPage",function(){U(a);let s=x(2);return Q(s.getListData())})("previousPage",function(){U(a);let s=x(2);return Q(s.getListData())})("nextPage",function(){U(a);let s=x(2);return Q(s.getListData())}),p()}if(o&2){let a=x(2);M("total",a.data().Data.length)("pageData",a.pageData())}}function z5(o,c){if(o&1){let a=Se();d(0,"mat-paginator",32),de("page",function(s){U(a);let m=x(2);return Q(m.onPaginationChange(s))}),p()}if(o&2){let a=x(2);M("length",a.pagination.listTotal())("pageSize",a.pagination.pageSize())("pageIndex",a.pageData().Filter.PageNumber==0?0:a.pageData().Filter.PageNumber-1)}}function Y5(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",2),de("onSubmit",function(){U(a);let s=x();return Q(s.searchFromPageOne())}),je("filterChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter,s)||(m.pageData().Filter=s),Q(s)}),d(1,"actions"),k(2,B5,5,1,"div",3)(3,F5,1,1),k(4,V5,3,0,"button",4),p(),d(5,"filters"),_i(6,R5,7,4,"ng-template",null,0,co),p(),d(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr",9),k(14,O5,2,1,"th",10),d(15,"th"),v(16,"Name"),p(),d(17,"th"),v(18,"Category"),p(),d(19,"th"),v(20,"Variant"),p(),d(21,"th"),v(22,"Code"),p(),k(23,U5,2,0,"th",11),d(24,"th",11),v(25,"Unit Price"),p(),k(26,Q5,2,0,"th",11),d(27,"th",11),v(28,"Outlet Price"),p(),d(29,"th",11),v(30,"%"),p()()(),d(31,"tbody"),Jt(32,q5,22,21,"tr",12,vi),p()(),k(34,G5,1,2,"POS-complex-pagination",13),p(),d(35,"div",14),k(36,z5,1,3,"mat-paginator",15),p()()()()}if(o&2){let a,l=x();M("pageData",l.menuData())("hideSearchBox",!0)("isFilterOnDropdown",!1),Le("filter",l.pageData().Filter),f(2),D(l.getSelectedData().length==((a=l.data().Data)==null?null:a.length)&&((a=l.data().Data)==null?null:a.length)>0?2:3),f(2),D(l.roleService.global.Export?4:-1),f(10),D(l.roleService.product.Delete?14:-1),f(9),D(l.roleService.product.Cost?23:-1),f(3),D(l.roleService.product.Cost?26:-1),f(6),Kt(l.data().Data),f(2),D(l.data().Data.length>0?34:-1),f(2),D(l.pagination.listTotal()>0?36:-1)}}var qd=class o extends Sl{constructor(a,l,s,m,h,_,w){super(l,s,"catalog/product/OutletPrice","catalog/ProductLoader/OutletPrice",m);this.csvConverter=a;this.httpService=s;this.toasterClient=h;this.roleService=_;this.matDialog=w}csvConverter;httpService;toasterClient;roleService;matDialog;deleteRowCustomOutlet(){let l=this.getSelectedData().map(s=>({key1:s.VariantID,key2:s.EntityID}));this.httpService.post("/api/catalog/product/DeleteOutletPrice",{Data:l}).subscribe(()=>{this.toasterClient.success("Success Custom Outlet Price",Zi.Success),this.getListData()})}onErase(a,l){this.getOutletPriceCount$().pipe(Gl(s=>this.matDialog.open(pg,{data:{title:"Erase Outlet Price(s)",message:`
|
|
1
|
+
import{a as Dd}from"./chunk-A6SE3QXT.js";import{a as wg}from"./chunk-W6CIVNQM.js";import{a as bg}from"./chunk-J5SPES4K.js";import"./chunk-JYFQIEYE.js";import{a as yd,b as Ac,d as Sc}from"./chunk-XSYDKAYT.js";import{a as cg}from"./chunk-4YGA4HTH.js";import{a as Id}from"./chunk-GUQERFKT.js";import{a as kc}from"./chunk-UQNLKJVP.js";import"./chunk-SAK6KLMJ.js";import{a as wc,b as hg,c as xg,d as _g,e as Cg,f as yg}from"./chunk-WFO4AMBS.js";import{a as Cd}from"./chunk-33G5WPLU.js";import{a as pg}from"./chunk-FFEJKFVT.js";import{a as dg,b as kd}from"./chunk-AVVWNWQB.js";import{a as _d,b as tf,c as nf,e as Ag}from"./chunk-ONP3DCYC.js";import"./chunk-RDGMLBYX.js";import{a as Ml}from"./chunk-RDR5QRH2.js";import{a as Ad}from"./chunk-2Y6XEGSQ.js";import{b as mg,c as fg,d as ug,e as vg,f as gg,g as Sd}from"./chunk-QIGTN3VT.js";import{a as il}from"./chunk-4OPSGGJV.js";import{a as wd}from"./chunk-2J5N4H5L.js";import{a as Ic}from"./chunk-X3EZKNFB.js";import{a as e1}from"./chunk-5IB4NAOH.js";import"./chunk-AIQCVDBX.js";import{a as sg}from"./chunk-Q3ZNI7UU.js";import{a as Gv}from"./chunk-G46E6JZA.js";import"./chunk-XAJYJKZY.js";import{a as Yv}from"./chunk-LAR7UELS.js";import{a as _c}from"./chunk-BBMCHQFM.js";import{a as vs}from"./chunk-WPC3FVPP.js";import{b as dd}from"./chunk-3UI7UC5E.js";import{a as B2}from"./chunk-2FC7VAOT.js";import{a as uc,b as H2}from"./chunk-NOXFZLVJ.js";import"./chunk-BJCHUBGO.js";import"./chunk-NNEANRX6.js";import{a as md}from"./chunk-I7ECOHHK.js";import{a as zv,b as cd}from"./chunk-F4W3MUBR.js";import{a as tl}from"./chunk-BPMDDE4D.js";import{a as fs}from"./chunk-5XSCMT3F.js";import{a as bd}from"./chunk-JG5N5RZJ.js";import{b as xd}from"./chunk-QP4KTVAU.js";import{b as ig,c as ng,e as ag,f as rg,g as hd}from"./chunk-FYCVHWE5.js";import{a as tg}from"./chunk-2E5HYZMR.js";import{a as og}from"./chunk-VLKLGJDL.js";import{a as lg}from"./chunk-P3KIIKY4.js";import"./chunk-AO63R3DI.js";import{b as vd}from"./chunk-ZPIILEA6.js";import{b as yc}from"./chunk-7HMU6MXA.js";import{a as Cc}from"./chunk-GWNGKIUL.js";import{a as gd}from"./chunk-2LD4VKHV.js";import{a as Dl}from"./chunk-OTOJ3MGJ.js";import"./chunk-BYXBJQAS.js";import{a as g1}from"./chunk-DDLXGCOB.js";import{a as ud}from"./chunk-52BMY5DH.js";import{a as Xv,c as $v,e as Zv,f as eg,g as fd}from"./chunk-53CYOKMD.js";import{a as kl}from"./chunk-QIUN3PYQ.js";import{a as Pv,b as U2,c as Q2,d as j2,e as L2}from"./chunk-MBSYHKPE.js";import"./chunk-PT6PCXOU.js";import{a as xc}from"./chunk-KIAB6W7M.js";import{a as Wv,e as Jv,f as Kv,g as pd}from"./chunk-ER2NCDJO.js";import{b as Kr}from"./chunk-P2NWTCME.js";import{a as gc}from"./chunk-S5BNZ74P.js";import{a as J2}from"./chunk-3XYL5JLY.js";import{c as q2}from"./chunk-F76MWCWQ.js";import"./chunk-XX7AIWP2.js";import{a as ld}from"./chunk-RCLIXTOJ.js";import{l as N2,m as Ax,p as Xr}from"./chunk-SCH7M36Q.js";import{d as V2}from"./chunk-7TQOVQ3O.js";import{c as O2}from"./chunk-G53IMHKY.js";import"./chunk-3EAA4CUP.js";import"./chunk-5U2B2SGN.js";import"./chunk-YJV74F2X.js";import"./chunk-WPCHBRKW.js";import{a as us,b as sd}from"./chunk-WUR7UGG2.js";import{b as k1}from"./chunk-C6AVODTR.js";import"./chunk-IIJLLEMO.js";import{a as id,c as nd}from"./chunk-GMYHR4TH.js";import{b as S1,c as I1,d as fc}from"./chunk-ANFR3NR4.js";import"./chunk-PZSSTNYS.js";import{d as ad}from"./chunk-YHZEJWGM.js";import{a as Zo}from"./chunk-WHKDTNK2.js";import{c as od}from"./chunk-WM2CE23W.js";import"./chunk-VFRVMDDY.js";import"./chunk-ESZD2F4X.js";import{a as Sl}from"./chunk-SBDHBCD4.js";import"./chunk-YASD3VTU.js";import{a as vc}from"./chunk-ONECCHQ5.js";import"./chunk-ROZU3QVN.js";import{b as td}from"./chunk-GKGUNK27.js";import{a as Z1}from"./chunk-XISCWQFV.js";import{c as Z2,d as qv,e as ed,f as tn,g as hc}from"./chunk-OZY277ZB.js";import{a as Ev,b as Tv,c as R2,d as Co}from"./chunk-M43FFEY2.js";import"./chunk-5VC2XYC5.js";import"./chunk-WRBKQHRI.js";import"./chunk-FS62MIXD.js";import{a as _o}from"./chunk-G56UPMKR.js";import"./chunk-BAIS4TWD.js";import"./chunk-XBINTEVI.js";import{a as G2,d as Bv,e as Nv,f as Fv,h as z2}from"./chunk-LN7LGRLI.js";import"./chunk-EP7SKSJT.js";import"./chunk-LAQZXTBX.js";import{c as rd}from"./chunk-QSFZAHQ2.js";import"./chunk-TGQEO6S3.js";import"./chunk-ONKLHHM3.js";import"./chunk-X2OQT5MH.js";import"./chunk-XTOFMSDQ.js";import"./chunk-ZM456L6A.js";import"./chunk-F5JDPCBG.js";import"./chunk-AWENDKAA.js";import{a as en}from"./chunk-AB35TLNF.js";import"./chunk-3DC26I3D.js";import{a as X2,b as $2}from"./chunk-UHM2XEMM.js";import{c as Il,d as K2}from"./chunk-UQSKGZO5.js";import{c as Dv,g as Mv,n as F2}from"./chunk-4BITXMRY.js";import"./chunk-2AOZZW2I.js";import"./chunk-TM2I5PAG.js";import{a as Ei,b as nr}from"./chunk-JXEPD3CF.js";import"./chunk-PPMQE2JW.js";import{B as Qv,F as jv,G as Lv,N as Hv,O as bc,g as el,h as Vv,m as Rv,o as Ov,r as Uv}from"./chunk-UI32X6QC.js";import"./chunk-OVCNCVGF.js";import{a as Y2,b as W2,d as $o}from"./chunk-BUIP3UCE.js";import"./chunk-PWMMCY25.js";import"./chunk-OKQYRKDJ.js";import"./chunk-SIAVPMSP.js";import{b as T2}from"./chunk-N5VS2V7L.js";import{a as X1,b as $1,c as Ma}from"./chunk-3V6FZIJD.js";import"./chunk-DEJ5V3PF.js";import"./chunk-T45W4CQR.js";import"./chunk-OK7LFGGQ.js";import"./chunk-VGLTFO5N.js";import"./chunk-UTSVZMZD.js";import{a as pc}from"./chunk-BP6PECKT.js";import{a as Da}from"./chunk-GNDUQZGK.js";import"./chunk-7KKUTTZ3.js";import"./chunk-ZS4XLRDB.js";import"./chunk-TYEI4SD2.js";import{a as Zi,b as K1,c as Xo}from"./chunk-BKOMMH62.js";import"./chunk-7ESJNFN4.js";import"./chunk-JTDKDDTJ.js";import"./chunk-3TKWEWIY.js";import{ra as Iv,ua as kv}from"./chunk-SXVOKLC4.js";import{A as Al,C as Sv,F as mc,G as P2,b as A1,c as Cn,e as ef,h as Vi,i as _v,l as Cv,m as r0,p as Ri,q as yv,r as wv,t as Av}from"./chunk-AJDQZ346.js";import"./chunk-TRJZVPIS.js";import"./chunk-YBESMONY.js";import"./chunk-YY6WVNU4.js";import{b as yi}from"./chunk-PUBGTLD3.js";import{a as Qi,b as xv}from"./chunk-PPTZHIIZ.js";import{a as E2}from"./chunk-5U6KKKXF.js";import{n as zi,q as ki}from"./chunk-QGYXJUX3.js";import{$a as se,$c as k2,Ab as vi,Ba as Qe,Bb as Jt,Cb as Kt,Da as rc,Db as M,E as ql,Ea as Wr,Eb as d,Fb as p,Fc as F,Ga as oc,Gb as G,Gc as Ce,Hc as Ie,Hd as bv,I as C2,Ic as S2,Id as hv,Jc as mv,Kb as zl,L as iv,Lb as Yl,Lc as co,Ld as dc,Na as W1,Oc as H1,P as nv,Pa as vl,Pb as Se,Pc as fv,Pd as Jn,R as av,Rd as ir,Sb as de,Sc as I2,Sd as li,Tc as Ci,Ua as f,Ub as x,Uc as uv,Ud as v1,Va as ov,Y as xo,Yb as ms,Yc as y1,Zb as Wl,_a as w2,_b as Jl,aa as Gl,ac as sv,bc as cv,cc as wa,db as nt,dc as Kl,e as ps,ea as C1,eb as lc,ec as hr,fb as A2,fc as Os,gc as Jo,hc as v,hd as vv,ib as $i,ic as Ae,jb as _i,jc as oe,kc as so,kd as Jr,l as a0,la as ac,lc as dv,m as tv,mc as Le,md as D2,nc as Oe,nd as cc,oa as dn,oc as je,od as M2,pc as Us,qc as sc,qd as w1,ra as U,rc as Qs,s as u1,sa as Q,sb as lv,sc as pv,sd as Vn,td as gv,ud as Li,wb as k,xc as ft,xd as tr,ya as y2,yb as D,yc as ot,za as rv,zb as J1,zc as Ko}from"./chunk-7D344CRC.js";import{a as kr,b as Fo,g as wx,j as nc}from"./chunk-NF7PG5F2.js";function Sx(o,c){o&1&&(d(0,"span",6),v(1,"Main"),p())}function Ix(o,c){if(o&1){let a=Se();d(0,"button",8),de("click",function(){U(a);let s=x().$index,m=x();return Q(m.onRemove(s))}),v(1," \xD7 "),p()}}function kx(o,c){if(o&1){let a=Se();d(0,"div",3),de("cdkDropListDropped",function(s){U(a);let m=x();return Q(m.drop(s))}),d(1,"div",4),de("click",function(s){let m=U(a).$implicit,h=x();return Q(h.onZoomImage(m.OnNewFormURL??m.URL,s))}),G(2,"img",5),k(3,Sx,2,0,"span",6),k(4,Ix,2,0,"button",7),p()()}if(o&2){let a=c.$implicit,l=c.$index,s=x();M("cdkDropListData",l),f(2),M("src",a.ImageURL||a.ImageUrl||"",vl)("alt",a.ImageName||"Product image"),f(),D(l===0?3:-1),f(),D(s.hasRole()?4:-1)}}function Dx(o,c){o&1&&(d(0,"div",10),G(1,"i",12),d(2,"div",13),v(3,"Upload Image"),p()())}function Mx(o,c){o&1&&G(0,"i",11)}function Ex(o,c){if(o&1){let a=Se();d(0,"div",9),de("click",function(){U(a);let s=x();return Q(s.openUploadDialog())}),k(1,Dx,4,0,"div",10)(2,Mx,1,0,"i",11),p()}if(o&2){let a=x();hr("piu-upload-area--full",a.images().length===0)("piu-upload-area--shrink",a.images().length>0)("piu-upload-area--disabled",!a.hasRole()),M("matTooltip",a.hasRole()?"Click to upload image":"You do not have permission to upload images"),f(),D(a.images().length===0?1:2)}}var gs=class o{role=dn(yi);dialog=dn(Ma);bigPicture=dn(vs);images=Ci([]);maxFile=Ci(5);cloudinaryFolder=Ci("");productID=Ci(null);imagesChange=I2();hasRole=H1(()=>this.role.product?.ImageEditor);slotAvailable=H1(()=>(this.images()?.length??0)<this.maxFile());canUpload=H1(()=>this.hasRole()&&this.slotAvailable());onRemove(c){let a=[...this.images()||[]];a.splice(c,1),this.imagesChange.emit(a)}openUploadDialog(){if(!this.canUpload())return;this.dialog.open(Ml,{data:{currentProductImagesLength:this.images()?.length??0,CloudinaryFolder:this.cloudinaryFolder(),productID:this.productID()}}).afterClosed().subscribe(a=>{a?.length&&(a=a.map(l=>Fo(kr({},l),{ProductID:this.productID()})),this.imagesChange.emit([...this.images()||[],...a]))})}onZoomImage(c,a){return nc(this,null,function*(){this.bigPicture.openBiggerPicture(a,c)})}drop(c){let a=[...this.images()||[]];G2(a,c.previousContainer.data,c.container.data),this.imagesChange.emit(a)}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-image-upload"]],inputs:{images:[1,"images"],maxFile:[1,"maxFile"],cloudinaryFolder:[1,"cloudinaryFolder"],productID:[1,"productID"]},outputs:{imagesChange:"imagesChange"},decls:4,vars:1,consts:[["cdkDropListGroup","",1,"d-flex","flex-wrap","gap-2","align-items-start","w-100"],["cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListData"],[1,"piu-upload-area",3,"matTooltip","piu-upload-area--full","piu-upload-area--shrink","piu-upload-area--disabled"],["cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListDropped","cdkDropListData"],["cdkDrag","",1,"piu-preview-item","cursor-pointer",3,"click"],["brokenImageIconFailSafe","",3,"src","alt"],[1,"piu-main-badge"],["type","button","aria-label","Remove image",1,"piu-remove-btn"],["type","button","aria-label","Remove image",1,"piu-remove-btn",3,"click"],[1,"piu-upload-area",3,"click","matTooltip"],[1,"text-center"],["aria-hidden","true",1,"fa-light","fa-image-circle-plus","fa-2x",2,"color","#9ca3af"],[1,"fa-light","fa-image-circle-plus","text-muted",2,"font-size","2rem"],[1,"piu-upload-label","mt-1","fs-6","text-muted"]],template:function(a,l){a&1&&(d(0,"div",0),Jt(1,kx,5,5,"div",1,vi),k(3,Ex,3,8,"div",2),p()),a&2&&(f(),Kt(l.images()),f(2),D(l.slotAvailable()?3:-1))},dependencies:[tr,nr,Ei,z2,Fv,Nv,Bv,kl],styles:[".piu-preview-item[_ngcontent-%COMP%]{position:relative;width:125px;height:125px;border-radius:6px;overflow:hidden;border:1px solid #e2e8f0;flex-shrink:0}.piu-preview-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.piu-preview-item[_ngcontent-%COMP%] .piu-main-badge[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;right:0;background:#0b5ed7d1;color:#fff;font-size:.6rem;font-weight:600;text-align:center;padding:2px 0;letter-spacing:.04em}.piu-preview-item[_ngcontent-%COMP%] .piu-remove-btn[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;border:none;background:#dc2626d9;color:#fff;font-size:.75rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s}.piu-preview-item[_ngcontent-%COMP%]:hover .piu-remove-btn[_ngcontent-%COMP%]{opacity:1}.piu-upload-area[_ngcontent-%COMP%]{border:1.5px dashed #d1d5db;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#fafafa;cursor:pointer;transition:border-color .15s,background .15s}.piu-upload-area[_ngcontent-%COMP%]:hover{border-color:#9ca3af;background:#f3f4f6}.piu-upload-area--full[_ngcontent-%COMP%]{width:100%;min-height:160px;flex-direction:column;gap:.25rem}.piu-upload-area--edit-mode[_ngcontent-%COMP%]{min-height:125px}.piu-upload-area--shrink[_ngcontent-%COMP%]{width:125px;height:125px;flex-shrink:0}.piu-upload-label[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#374151}.piu-upload-hint[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af}.piu-upload-area--disabled[_ngcontent-%COMP%]{opacity:.45;cursor:not-allowed}"],changeDetection:0})};var Md=class o{constructor(c,a){this.dialogRef=c;this.data=a;this.Model=a,this.configModal=new K1,this.configModal.title="Move to Category"}dialogRef;data;Model;configModal;onOk(){this.dialogRef.close({Model:this.Model})}static \u0275fac=function(a){return new(a||o)(se(X1),se($1))};static \u0275cmp=nt({type:o,selectors:[["POS-modal-move-category"]],standalone:!1,decls:6,vars:4,consts:[[3,"onOk","onCancel","onClose","config"],[1,"section-content",2,"width","332px","max-width","100%"],[1,"row"],[1,"col-sm-12"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),d(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"POS-product-category-select",4),je("selectedCategoryIDChange",function(m){return Oe(l.Model.Form.CategoryID,m)||(l.Model.Form.CategoryID=m),m}),p()()()()()()),a&2&&(M("config",l.configModal),f(5),Le("selectedCategoryID",l.Model.Form.CategoryID),M("showClear",!0)("continuedCategoriesOnly",!0))},dependencies:[Xo,k1],encapsulation:2})};var l0=(l=>(l[l.NEVER=0]="NEVER",l[l.QUERY=1]="QUERY",l[l.ALWAYS=2]="ALWAYS",l))(l0||{});function Px(o,c){if(o&1&&(d(0,"ng-conntainer")(1,"span",11),v(2),F(3,"async"),F(4,"number"),p()()),o&2){let a=x();f(2),Ae(Ce(4,3,Ce(3,1,a.totalRowCount$)))}}function Bx(o,c){if(o&1){let a=Se();d(0,"span",19)(1,"i",20),de("click",function(){U(a);let s=x();return Q(s.onShowTotal())}),v(2,"?"),p()()}}var Td=class o{constructor(c,a,l){this.data=c;this.dialogRef=a;this.httpService=l;this.modalConfig=new K1,this.modalConfig.title=c.title,this.modalConfig.headerType=Zi.Success}data;dialogRef;httpService;modalConfig;pageNumber=1;pageSize=1e4;startExport=1;endExport;isShowTotal=!1;totalCount=1e4;isExportCsv=!0;totalRowCount$;ngOnInit(){this.countExportRowCount()}onPageNumberChange(c){this.pageNumber=c,this.countExportRowCount()}exportCSV(){this.dialogRef.close(1)}ExportXlsx(){this.dialogRef.close(2)}countExportRowCount(){let c=1e4;this.pageNumber>1?(this.totalCount-this.pageNumber*c>0?this.endExport=this.pageNumber*c:this.endExport=this.totalCount,this.startExport=this.pageNumber-1==1?c+1:(this.pageNumber-1)*c+1,this.startExport>this.totalCount&&(this.startExport=this.totalCount)):(this.startExport=this.pageNumber,this.endExport=this.totalCount>c?c:this.totalCount)}onShowTotal(){this.isShowTotal=!0,this.totalRowCount$=this.httpService.post("/api/catalog/product/ProductRowsCount",{}).pipe(u1(c=>(this.totalCount=c.Count,this.countExportRowCount(),c.Count)))}onSave(){this.dialogRef.close({pageSize:this.pageSize,pageNumber:this.pageNumber,isExportCsv:this.isExportCsv})}onCancel(){this.dialogRef.close("CANCEL")}static \u0275fac=function(a){return new(a||o)(se($1),se(X1),se(ki))};static \u0275cmp=nt({type:o,selectors:[["POS-modal-export-product"]],standalone:!1,decls:36,vars:15,consts:[[3,"onCancel","onOk","config"],[1,"container-fluid"],[1,"row","border","p-4","border-secondary"],[1,"col-12","ps-0","d-flex","justify-content-center"],["aria-label","Select an option",3,"ngModelChange","ngModel"],[1,"me-4",3,"value"],[1,"fa-solid","fa-file-csv","me-1","fs-4"],[3,"value"],[1,"fa-solid","fa-file-excel","me-1","fs-4"],[1,"row","mt-8"],[1,"col-6","ps-0","pe-3"],[1,"fw-bold"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-6","pe-0","ps-3"],[1,"border","border-2","border-secondary","ps-3","pt-3","bg-light",2,"height","32px"],[1,"row","mt-4"],[1,"col-12","p-0"],[1,"border","border-1","ps-3","pt-3","alert-warning",2,"height","32px"],[1,"fa-solid","fa-circle-info","me-1"],[2,"cursor","pointer"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","py-1","px-3",3,"click"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onCancel",function(){return l.dialogRef.close()})("onOk",function(){return l.onSave()}),d(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"mat-radio-group",4),je("ngModelChange",function(m){return Oe(l.isExportCsv,m)||(l.isExportCsv=m),m}),d(6,"mat-radio-button",5),G(7,"i",6),v(8," Export CSV "),p(),d(9,"mat-radio-button",7),G(10,"i",8),v(11," Export XLSX "),p()()()(),d(12,"div",9)(13,"div",10)(14,"label",11),v(15,"Page Number"),p(),d(16,"input",12),je("ngModelChange",function(m){return Oe(l.pageNumber,m)||(l.pageNumber=m),m}),de("ngModelChange",function(m){return l.onPageNumberChange(m)}),p()(),d(17,"div",13)(18,"label",11),v(19,"Page Size"),p(),d(20,"div",14),v(21),F(22,"number"),p()()(),d(23,"div",15)(24,"div",16)(25,"div",17),G(26,"i",18),v(27," Exporting ["),d(28,"span",11),v(29),F(30,"number"),F(31,"number"),p(),v(32,"] record of "),k(33,Px,5,5,"ng-conntainer")(34,Bx,3,0,"span",19),v(35," transactions "),p()()()()()()),a&2&&(M("config",l.modalConfig),f(5),Le("ngModel",l.isExportCsv),f(),M("value",!0),f(3),M("value",!1),f(7),Le("ngModel",l.pageNumber),f(5),oe(" ",Ce(22,9,l.pageSize)),f(8),so("",Ce(30,11,l.startExport)," - ",Ce(31,13,l.endExport)),f(4),D(l.isShowTotal?33:34))},dependencies:[Ei,Xo,Cn,Vi,Ri,Ev,Tv,_o,w1,Li],encapsulation:2})};var Sg={Category:"Category",Product:"Product",ProductCode:"Product Code",Variant:"Variant",Code:"Code",Supplier:"Supplier",UnitCost:"Unit Cost",UnitPrice:"Unit Price",MinimumSellPrice:"Minimum Sell Price",LastBuyCost:"Last Buy Cost",MaximumBuyCost:"Maximum Buy Cost",CostDiscount:"Cost Discount",PriceDiscount:"Price Discount",LandedCost:"Landed Cost",Type:"Type",UOM:"UOM",Released:"Released",ProductID:"Product ID",ID:"ID",ProductDescription:"Product Description",Description:"Description",Discontinued:"Discontinued",VariantDiscontinued:"Variant Discontinued",PaymentType:"Payment Type",LoyaltyPoint:"Loyalty Point",Brand:"Brand",Taxable:"Taxable",ImageURL:"Image URL",VariantImageURL:"Variant Image URL",UnitQuantity:"Unit Quantity",Weight:"Weight",CostCurrency:"Cost Currency",ProductCostCurrency:"Product Cost Currency",VariantCostCurrency:"Variant Cost Currency"};var Fx=(o,c)=>({width:o,height:c}),kg=o=>({"text-decoration-line-through":o}),Vx=()=>["/menu/Products/Catalog/Products/Info"],Dg=o=>({ID:o}),Rx=()=>["/menu/Products/Catalog/Variants/Info"];function Ox(o,c){if(o&1){let a=Se();d(0,"th",3)(1,"input",10),de("change",function(s){U(a);let m=x();return Q(m.onSelectAllProducts(s.target.checked))}),p()()}}function Ux(o,c){o&1&&(d(0,"th",8),v(1,"Price"),p())}function Qx(o,c){if(o&1){let a=Se();d(0,"td",3)(1,"input",20),je("ngModelChange",function(s){U(a);let m=x().$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),p()()}if(o&2){let a=x().$implicit;f(),Le("ngModel",a.selected)}}function jx(o,c){if(o&1&&(d(0,"i",16),G(1,"br"),v(2),F(3,"sum"),F(4,"quantityFraction"),p()),o&2){let a=x().$implicit;f(2),oe(" ( ",Ce(4,4,Ie(3,1,a.Variants,"Inventory"))," On Hand ) ")}}function Lx(o,c){if(o&1&&(d(0,"i",23),v(1),p()),o&2){let a=x(3).$implicit;f(),Ae(" - "+a.Allocated+" Allocated ")}}function Hx(o,c){if(o&1&&k(0,Lx,2,1,"i",23),o&2){let a=x(2).$implicit;D(a.Allocated?0:-1)}}function qx(o,c){if(o&1&&(d(0,"i",16),v(1),F(2,"quantityFraction"),p(),k(3,Hx,1,1)),o&2){let a=x().$implicit;f(),oe("( ",a.Inventory==null?0:Ce(2,2,a.Inventory)," On Hand )"),f(2),D(a.TypeID!=2?3:-1)}}function Gx(o,c){if(o&1&&(d(0,"li",21)(1,"a",22)(2,"span"),v(3),p()(),d(4,"small"),v(5),p(),k(6,qx,4,4),p()),o&2){let a=c.$implicit,l=x(3);f(),M("target",pv(l.pageData.LinkTarget))("routerLink",ft(9,Rx))("queryParams",ot(10,Dg,a.ID)),f(),Jo(ot(12,kg,a.Discontinued)),f(),Ae(a.Model),f(2),Ae(a.Code),f(),D(l.roleService.inventory.View&&(l.pageData.InventoryRenderScenario==l.renderScenario.ALWAYS||l.pageData.InventoryRenderScenario==l.renderScenario.QUERY&&l.pageData.Filter.Text)?6:-1)}}function zx(o,c){if(o&1&&(d(0,"ul",18),Jt(1,Gx,7,14,"li",21,vi),p()),o&2){let a=x().$implicit;f(),Kt(a.Variants)}}function Yx(o,c){if(o&1&&(v(0),F(1,"MinToMax")),o&2){let a=x(2).$implicit;oe(" ",Ie(1,1,a.Variants,"UnitPrice")," ")}}function Wx(o,c){if(o&1&&(d(0,"td",19),k(1,Yx,2,4),p()),o&2){let a=x().$implicit;f(),D(a.Variants?1:-1)}}function Jx(o,c){if(o&1){let a=Se();d(0,"tr"),k(1,Qx,2,1,"td",3),d(2,"td")(3,"div",11)(4,"div",12)(5,"img",13),de("click",function(s){let m=U(a).$implicit,h=x();return Q(h.onOpenBigPicture(m,s))}),p()(),d(6,"div",14)(7,"a",15),v(8),p()()()(),d(9,"td"),v(10),k(11,jx,5,6,"i",16),p(),d(12,"td"),v(13),p(),d(14,"td",17),k(15,zx,3,0,"ul",18),p(),k(16,Wx,2,1,"td",19),d(17,"td"),v(18),F(19,"date"),p()()}if(o&2){let a=c.$implicit,l=x();f(),D(l.roleService.product!=null&&l.roleService.product.Delete||l.roleService.product!=null&&l.roleService.product.Edit?1:-1),f(4),Os(Ko(23,Fx,l.data.ThumbnailWidth+"px",l.data.ThumbnailWidth+"px")),M("src",a.ThumbnailUrl,vl)("width",l.data.ThumbnailWidth+"px")("height",l.data.ThumbnailWidth+"px")("linkTarget",l.pageData.LinkTarget)("redirectUrl","/menu/Products/Catalog/Products/Info/?ID="+a.ID),f(2),Jo(ot(26,kg,a.Discontinued)),M("routerLink",ft(28,Vx))("queryParams",ot(29,Dg,a.ID))("target",l.pageData.LinkTarget),f(),Ae(a.Name),f(2),oe(" ",a.Code," "),f(),D(l.roleService.inventory.View&&(l.pageData.InventoryRenderScenario==l.renderScenario.ALWAYS||l.pageData.InventoryRenderScenario==l.renderScenario.QUERY&&l.pageData.Filter.Text)?11:-1),f(2),oe(" ",a.Category," "),f(2),D(a.Variants?15:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible?16:-1),f(2),oe(" ",a.Released==l.minDate?"":Ie(19,20,a.Released,"dd MMM yy")," ")}}var Pd=class o{constructor(c){this.roleService=c}roleService;data;infiniteList;pageData;maskingFields;maskingFieldMsg=T2.maskingField;minDate=Qi.MinDate;selectAllProducts=new y2;openBigPicture=new y2;sort=new y2;renderScenario=l0;onSelectAllProducts(c){this.selectAllProducts.emit(c)}onOpenBigPicture(c,a){this.openBigPicture.emit({product:c,pEvent:a})}sortData(c){this.sort.emit(c)}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-product-list-desktop"]],inputs:{data:"data",infiniteList:"infiniteList",pageData:"pageData",maskingFields:"maskingFields"},outputs:{selectAllProducts:"selectAllProducts",openBigPicture:"openBigPicture",sort:"sort"},standalone:!1,decls:18,vars:2,consts:[["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","14px"],[2,"width","320px"],["mat-sort-header","Code",2,"width","120px"],[2,"width","110px"],[2,"width","300px","max-width","300px"],[1,"text-end",2,"width","140px"],[2,"width","80px"],["type","checkbox",3,"change"],[1,"d-flex","flex-row"],[2,"cursor","pointer","flex-shrink","0"],["matTooltipPosition","above","matTooltip","Click to zoom","brokenImageIconFailSafe","",1,"product-thumbnail",3,"click","src","width","height","linkTarget","redirectUrl"],[1,"ps-2"],[1,"align-top",3,"routerLink","queryParams","target"],[1,"text-danger","small"],[1,"variant-cell"],[1,"nav"],[1,"text-end"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"nav-item","me-8"],[1,"nav-link",2,"padding","0",3,"routerLink","queryParams","target"],[1,"small"]],template:function(a,l){a&1&&(d(0,"table",0),de("matSortChange",function(m){return l.sortData(m)}),d(1,"thead",1)(2,"tr",2),k(3,Ox,2,0,"th",3),d(4,"th",4),v(5,"Product"),p(),d(6,"th",5),v(7,"Code"),p(),d(8,"th",6),v(9,"Category"),p(),d(10,"th",7),v(11,"Variants"),p(),k(12,Ux,2,0,"th",8),d(13,"th",9),v(14,"Released"),p()()(),d(15,"tbody"),Jt(16,Jx,20,31,"tr",null,vi),p()()),a&2&&(f(3),D(l.roleService.product!=null&&l.roleService.product.Delete||l.roleService.product!=null&&l.roleService.product.Edit?3:-1),f(9),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible?12:-1),f(4),Kt(l.infiniteList))},dependencies:[Ei,li,A1,Vi,Ri,S1,I1,kl,Vn,el,Rv,J2],styles:[".product-thumbnail[_ngcontent-%COMP%]{object-fit:cover;border-radius:4px}.variant-cell[_ngcontent-%COMP%]{max-width:300px}.variant-cell[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%]{display:flex;flex-direction:column}@media(max-width:991.98px){.variant-cell[_ngcontent-%COMP%]{max-width:none;overflow-x:auto}.variant-cell[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%]{flex-wrap:nowrap;width:max-content}}"],changeDetection:0})};var $x=()=>["/menu/Products/Catalog/Products/Import"],Zx=()=>["/menu/Products/Catalog/Products/Form"];function e_(o,c){if(o&1){let a=Se();d(0,"a",17),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkDiscontinue"))}),G(1,"i",18),v(2," Discontinue "),p()}}function t_(o,c){if(o&1){let a=Se();d(0,"a",17),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkReactivate"))}),G(1,"i",19),v(2," Continue "),p()}}function i_(o,c){if(o&1&&k(0,e_,3,0,"a",16)(1,t_,3,0,"a",16),o&2){let a=x(2);D(a.pageData().Filter.ProductDiscontinued?1:0)}}function n_(o,c){if(o&1){let a=Se();d(0,"a",20),de("click",function(){U(a);let s=x(2);return Q(s.httpPostListID("catalog/product/DeleteProductList"))}),G(1,"i",21),v(2," Delete "),p()}}function a_(o,c){if(o&1){let a=Se();d(0,"a",23),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkDiscontinue"))}),G(1,"i",19),v(2," Discontinue "),p()}}function r_(o,c){if(o&1){let a=Se();d(0,"a",23),de("click",function(){U(a);let s=x(3);return Q(s.httpPostListID("catalog/product/BulkReactivate"))}),G(1,"i",18),v(2," Continue "),p()}}function o_(o,c){if(o&1&&(d(0,"li",15),k(1,a_,3,0,"a",22)(2,r_,3,0,"a",22),p()),o&2){let a=x(2);f(),D(a.pageData().Filter.ProductDiscontinued?2:1)}}function l_(o,c){if(o&1){let a=Se();d(0,"li",15)(1,"a",24),de("click",function(){U(a);let s=x(2);return Q(s.mergeData())}),G(2,"i",25),v(3," Merge Variant "),p()()}}function s_(o,c){if(o&1){let a=Se();d(0,"li",15)(1,"a",26),de("click",function(){U(a);let s=x(2);return Q(s.moveProduct("catalog/product/MoveProduct"))}),G(2,"i",27),v(3," Move "),p()()}}function c_(o,c){if(o&1&&(d(0,"div",2),k(1,i_,2,1)(2,n_,3,0,"a",12),G(3,"button",13),d(4,"ul",14),k(5,o_,3,1,"li",15),k(6,l_,4,0,"li",15),k(7,s_,4,0,"li",15),p()()),o&2){let a=x();f(),D(a.roleService.product!=null&&a.roleService.product.Delete?2:1),f(4),D(a.roleService.product!=null&&a.roleService.product.Delete?5:-1),f(),D(a.getSelectedData().length>1&&(a.roleService.product!=null&&a.roleService.product.Edit)?6:-1),f(),D(a.roleService.product!=null&&a.roleService.product.Edit?7:-1)}}function d_(o,c){o&1&&(d(0,"a",3),G(1,"i",28),v(2," Import"),p()),o&2&&M("routerLink",ft(1,$x))}function p_(o,c){if(o&1){let a=Se();d(0,"a",29),de("click",function(){U(a);let s=x();return Q(s.openExportModal())}),G(1,"i",30),v(2," Export "),p()}}function m_(o,c){o&1&&(d(0,"a",5),v(1,"Add"),p()),o&2&&M("routerLink",ft(1,Zx))}function f_(o,c){if(o&1&&(d(0,"div",49)(1,"span",50),v(2),p(),d(3,"span",51),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function u_(o,c){if(o&1&&(d(0,"div",49)(1,"span",50),v(2),p(),d(3,"span",51),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function v_(o,c){if(o&1){let a=Se();d(0,"div",31)(1,"div",32)(2,"h6"),v(3,"Category"),p(),d(4,"POS-product-category-select",33),je("selectedCategoryIDChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.CategoryID,s)||(m.pageData().Filter.CategoryID=s),Q(s)}),p()(),d(5,"div",32)(6,"h6"),v(7,"Brand"),p(),d(8,"POS-brand-options-v2",34),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.BrandIDs,s)||(m.pageData().Filter.BrandIDs=s),Q(s)}),p()(),d(9,"div",32)(10,"h6"),v(11,"Tags"),p(),d(12,"ng-select",35),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.TagsID,s)||(m.pageData().Filter.TagsID=s),Q(s)}),p()(),d(13,"div",32)(14,"h6"),v(15,"Supplier"),p(),d(16,"autocompleteV2",36),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.SupplierID,s)||(m.pageData().Filter.SupplierID=s),Q(s)}),p()(),d(17,"div",32)(18,"h6"),v(19,"Released From"),p(),d(20,"datepicker",37),je("dateChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.From,s)||(m.pageData().Filter.From=s),Q(s)}),p()(),d(21,"div",32)(22,"h6"),v(23,"Released To"),p(),d(24,"datepicker",38),je("dateChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.To,s)||(m.pageData().Filter.To=s),Q(s)}),p()(),d(25,"div",32)(26,"h6"),v(27,"Cost Currency"),p(),d(28,"ng-select",39),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.ProductCostCurrencyID,s)||(m.pageData().Filter.ProductCostCurrencyID=s),Q(s)}),_i(29,f_,5,2,"ng-template",40)(30,u_,5,2,"ng-template",41),p()(),d(31,"div",32)(32,"h6"),v(33,"Order By"),p(),d(34,"radio-options",42),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.OrderBy,s)||(m.pageData().Filter.OrderBy=s),Q(s)}),p()(),d(35,"div",32)(36,"h6"),v(37,"Order Direction"),p(),d(38,"radio-options",43),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.SortBy,s)||(m.pageData().Filter.SortBy=s),Q(s)}),p()(),d(39,"div",32)(40,"h6"),v(41,"Category Discontinued"),p(),d(42,"radio-options",44),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.CategoryDiscontinued,s)||(m.pageData().Filter.CategoryDiscontinued=s),Q(s)}),p()(),d(43,"div",32)(44,"h6"),v(45,"Product Discontinued"),p(),d(46,"radio-options",45),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.ProductDiscontinued,s)||(m.pageData().Filter.ProductDiscontinued=s),Q(s)}),p()(),d(47,"div",32)(48,"h6"),v(49,"Variant Discontinued"),p(),d(50,"radio-options",46),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.VariantDiscontinued,s)||(m.pageData().Filter.VariantDiscontinued=s),Q(s)}),p()(),d(51,"div",32)(52,"h6"),v(53,"Search Mode"),p(),d(54,"radio-options",47),je("modelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.SearchMode,s)||(m.pageData().Filter.SearchMode=s),Q(s)}),p()(),d(55,"div",32)(56,"h6"),v(57,"Inventory By Outlet Group"),p(),d(58,"ng-select",48),je("ngModelChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.EntityGroupID,s)||(m.pageData().Filter.EntityGroupID=s),Q(s)}),p()()()}if(o&2){let a,l,s,m,h,_,w,A,I=x();f(4),Le("selectedCategoryID",I.pageData().Filter.CategoryID),M("showClear",!0)("continuedCategoriesOnly",!0),f(4),Le("ngModel",I.pageData().Filter.BrandIDs),M("multiple",!0)("placeholder","Choose Brand")("clearable",!0),f(4),M("items",(a=I.pageData().Options)==null?null:a.Tags),Le("ngModel",I.pageData().Filter.TagsID),f(4),Le("ngModel",I.pageData().Filter.SupplierID),f(4),Le("date",I.pageData().Filter.From),f(4),Le("date",I.pageData().Filter.To),f(4),M("items",I.pageData().Options.CurrencyOptions),Le("ngModel",I.pageData().Filter.ProductCostCurrencyID),f(6),Le("model",I.pageData().Filter.OrderBy),M("options",(l=I.pageData().Options)==null?null:l.OrderByOptions),f(4),Le("model",I.pageData().Filter.SortBy),M("options",(s=I.pageData().Options)==null?null:s.SortByOptions),f(4),Le("model",I.pageData().Filter.CategoryDiscontinued),M("options",(m=I.pageData().Options)==null?null:m.CategoryDiscontinuedOptions),f(4),Le("model",I.pageData().Filter.ProductDiscontinued),M("options",(h=I.pageData().Options)==null?null:h.ProductDiscontinuedOptions),f(4),Le("model",I.pageData().Filter.VariantDiscontinued),M("options",(_=I.pageData().Options)==null?null:_.VariantDiscontinuedOptions),f(4),Le("model",I.pageData().Filter.SearchMode),M("options",(w=I.pageData().Options)==null?null:w.SearchModeOptions),f(4),M("items",(A=I.pageData().Options)==null?null:A.EntityGroups),Le("ngModel",I.pageData().Filter.EntityGroupID)}}function g_(o,c){if(o&1){let a=Se();d(0,"infinite-pagination",52),de("nextPage",function(){U(a);let s=x();return Q(s.NextPage(!0))})("fetchTotalData",function(){U(a);let s=x();return Q(s.StoreRowsCountAPIResult("catalog/product/ProductRowsCount"))}),p()}if(o&2){let a,l,s=x();M("totalData",s.listTotal())("totalCurrentRow",s.infiniteList==null?null:s.infiniteList.length)("pageNumber",(a=s.pageData())==null||a.Filter==null?null:a.Filter.PageNumber)("nextPageDisabled",!1)("hasShowAllButton",!1)("isFetchTotalData",(l=s.pageData())==null?null:l.HideStoreApiCount)}}var Bd=class o extends fs{constructor(a,l,s,m,h,_,w){super(a,l,"catalog/product/GetProductList","catalog/ProductLoader/ProductList",s,w);this.httpService=l;this.csvConverter=m;this.matDialog=h;this.roleService=_}httpService;csvConverter;matDialog;roleService;bigPicture=dn(vs);minDate=Qi.MinDate;more=!1;maskingFields;renderScenario=l0;isHasBrandRestriction=H1(()=>!!this.pageData().Filter.BrandIDs&&this.pageData().Filter.BrandIDs.length>0&&!this.brandIdSelectedChange());brandIdSelectedChange=Qe(!1);trackByKey=(a,l)=>l.Key;preInitList(){let a=this.route?.snapshot?.queryParams?.BrandID;Qi.IsNotEmpty(a)&&(this.pageData().Filter.BrandID=a)}preGetList(){super.preGetList();let{categoryID:a}=this.route?.snapshot?.queryParams;Qi.IsNotEmpty(a)&&(this.pageData().Filter.CategoryID=a)}postInit(a){super.postInit(a),this.maskingFields=Qi.generateMaskingField(this.pageData().MaskFields)}Select_Export(){this.matDialog.open(Td,{data:{title:"Export Products"},width:"400px"}).afterClosed().pipe(ql(l=>l!=="CANCEL")).subscribe(l=>{this.pageData().Filter.ExportPageNumber=l.pageNumber,this.pageData().Filter.ExportRowCount=l.pageSize,l.isExportCsv?this.exportCSV(this.csvConverter,"ProductExport/ExportProductList","Product.csv"):this.exportXlsx("ProductExport/ExportProductListExcel")})}moveProduct(a){let l=this.getSelectedData();this.matDialog.open(Md,{data:{Form:{CategoryID:null},Options:this.pageData().Options}}).afterClosed().subscribe(m=>{if(m){let h=m.Model.Form.CategoryID,_=l.map(w=>w.ID);this.postData(a,{ID:h,List:_})}})}s2ab(a){for(var l=new ArrayBuffer(a.length),s=new Uint8Array(l),m=0;m!=a.length;++m)s[m]=a.charCodeAt(m)&255;return l}exportXlsx(a){this.pageData().Filter.FormatType=1,this.httpService.post(`/api/${a}`,this.pageData().Filter).subscribe(l=>{let s="Product.xlsx";s=decodeURI(s);let m=window.URL.createObjectURL(new Blob([this.s2ab(atob(l))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),h=document.createElement("a");h.href=m,h.setAttribute("download",s),document.body.appendChild(h),h.click(),window.URL.revokeObjectURL(m),h.remove()})}mergeData(){let a=this.getSelectedData();this.matDialog.open(cg,{data:{data:a,title:"Choose Merge Target",actionTitle:"Move",columns:[{type:"text",field:"Name"},{type:"text",field:"Code"}],headers:["Name","Code"]},width:"500px"}).afterClosed().pipe(ql(l=>l),Gl(l=>this.mergeVariant(l.mergeTarget,l.deleted))).subscribe(()=>{this.toastrService?.success("Variant records have been merged successfully.",Zi.Success),this.getListData()})}mergeVariant(a,l){let s={mergeTarget:a,deleted:l};return this.httpService.put(Da.MergeProduct,s)}openBiggerPicture(a){return nc(this,null,function*(){this.bigPicture.openBiggerPicture(a.pEvent,a.product.ImageUrl)})}openExportModal(){let a=this.pageData().Options?.ExportColumnOptions,l=a?.length?"product-export/default-with-selection":"ProductExport/ExportProductList";this.matDialog.open(Kr,{data:{title:"Product",exportTypes:[{ID:l,Value:"Default",FileName:"Product"},{ID:"ProductExport/ExportProductListWithOutletPrice",Value:"Outlet Price",FileName:"Export with Outlet Price"},{ID:"ProductExport/ExportProductListWithPricebook",Value:"Pricebook",FileName:"Export with Pricebook"},{ID:"ProductExport/ExportProductListWithComponents",Value:"Components",FileName:"Export with Components"},{ID:"ProductExport/ExportProductListWithParent",Value:"Multi Unit",FileName:"Export with Multi Unit"},{ID:"ProductExport/ExportProductListWithSerial",Value:"Serial",FileName:"Export with Serial"},{ID:"ProductExport/ExportProductListWithSerialAndRow",Value:"Serial and Row",FileName:"Export with Serial and Row"},{ID:"ProductExport/ExportProductListWithTags",Value:"Tags",FileName:"Export with Tags"},{ID:"ProductExport/ExportProductListWithSalesGroupCommission",Value:"Commission",FileName:"Export with Commission"},{ID:"ProductExport/ExportProductListWithInventory",Value:"Inventory",FileName:"Export with Inventory"},{ID:"ProductExport/ExportProductListWithWarehouseLocation",Value:"Warehouse",FileName:"Export with Warehouse"},{ID:"ProductExport/ExportProductListMinMaxWithInventory",Value:"ROP & Max Inventory",FileName:"Export with ROP & Max Inventory"},{ID:"ProductExport/ExportProductListWithPreapaid",Value:"Prepaid",FileName:"Export with Prepaid"},{ID:"ProductExport/ExportProductListDigitalScale",Value:"Digital Scale",TxtOnly:!0},{ID:"ProductExport/ExportProductListWithDisplayName",Value:"Display Name",FileName:"Export with Display Name"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"catalog/product/ProductRowsCount",pagination:!0,extraExportTypesOptions:[{value:"TXT",label:"TXT",icon:"fa-file-invoice fas",formatType:2}],exportColumnOptions:a,exportColumnDefaultCount:10,customizeColumnsExportType:"product-export/default-with-selection",exportColumnDisplayMap:Sg}})}sortData(a){let l=this.infiniteList.slice();if(!a.active||a.direction===""){this.infiniteList=this.originalData();return}this.infiniteList=l.sort((s,m)=>{let h=a.direction==="asc",_=typeof s[a.active];switch(Qi.IsEmpty(s.Code)&&(s.Code=""),Qi.IsEmpty(m.Code)&&(m.Code=""),_){case"string":return Qi.compare(s[a.active].toLocaleLowerCase(),m[a.active].toLocaleLowerCase(),h);case"number":return Qi.compare(s[a.active],m[a.active],h);default:return 0}})}onFilterBrand(a){this.pageData().Filter.BrandIDs=a,this.brandIdSelectedChange.set(!0)}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(zi),se(Z1),se(Ma),se(yi),se(Jn))};static \u0275cmp=nt({type:o,selectors:[["POS-product"]],standalone:!1,features:[$i],decls:17,vars:13,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary"],["data-cy","AddProduct","role","button","matTooltipPosition","above","matTooltip","Add Product",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[3,"selectAllProducts","openBigPicture","sort","data","infiniteList","pageData","maskingFields"],[1,"me-auto","mt-3"],[1,"fw-bold","fst-italic"],[3,"totalData","totalCurrentRow","pageNumber","nextPageDisabled","hasShowAllButton","isFetchTotalData"],["data-cy","DeleteProduct",1,"btn","btn-outline-secondary","border-end-0"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item"],["data-cy","DiscountinueProduct",1,"btn","btn-outline-secondary","border-end-0"],["data-cy","DiscountinueProduct",1,"btn","btn-outline-secondary","border-end-0",3,"click"],[1,"fa-solid","fa-ban"],[1,"fa-solid","fa-circle-check"],["data-cy","DeleteProduct",1,"btn","btn-outline-secondary","border-end-0",3,"click"],[1,"fa-solid","fa-trash"],["data-cy","DiscountinueProduct"],["data-cy","DiscountinueProduct",3,"click"],["title","2 products with 1 variant each will be merged into 1 product with 2 variants",3,"click"],[1,"fa-solid","fa-merge"],["matTooltipPosition","above","matTooltip","Move",3,"click"],[1,"fa-solid","fa-arrows-up-down-left-right"],["aria-hidden","true",1,"fa-solid","fa-download"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose Category...",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear","continuedCategoriesOnly"],[3,"ngModelChange","ngModel","multiple","placeholder","clearable"],["bindLabel","Name","bindValue","ID","placeholder","Choose Tag...",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier...",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],["bindValue","Key","bindLabel","Value","placeholder","Choose Currency...","appendTo","body",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["name","OrderBy",3,"modelChange","model","options"],["name","SortBy",3,"modelChange","model","options"],["name","CategoryDiscontinued",3,"modelChange","model","options"],["name","ProductDiscontinued",3,"modelChange","model","options"],["name","VariantDiscontinued",3,"modelChange","model","options"],["name","SearchMode",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],[3,"nextPage","fetchTotalData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","hasShowAllButton","isFetchTotalData"]],template:function(l,s){if(l&1){let m=Se();d(0,"mainpanel-cmp",1),je("textChange",function(_){return U(m),Oe(s.pageData().Filter.Text,_)||(s.pageData().Filter.Text=_),Q(_)}),de("onSubmit",function(){return s.searchFromPageOne()}),je("filterChange",function(_){return U(m),Oe(s.pageData().Filter,_)||(s.pageData().Filter=_),Q(_)}),d(1,"actions"),k(2,c_,8,4,"div",2),d(3,"div",2),k(4,d_,3,2,"a",3),k(5,p_,3,0,"a",4),p(),k(6,m_,2,2,"a",5),p(),d(7,"filters"),_i(8,v_,59,28,"ng-template",null,0,co),p(),d(10,"content")(11,"div",6)(12,"div",7)(13,"POS-product-list-desktop",8),de("selectAllProducts",function(_){return s.onSelectAllData(_)})("openBigPicture",function(_){return s.openBiggerPicture(_)})("sort",function(_){return s.sortData(_)}),p()(),d(14,"div",9)(15,"div",10),k(16,g_,1,6,"infinite-pagination",11),p()()()()()}l&2&&(M("pageData",s.menuData()),Le("text",s.pageData().Filter.Text),M("isFilterOnDropdown",!1),Le("filter",s.pageData().Filter),f(2),D(s.getSelectedData().length>0&&(s.roleService.product!=null&&s.roleService.product.Edit||s.roleService.product!=null&&s.roleService.product.Delete)?2:-1),f(2),D(!(s.roleService==null||s.roleService.product==null)&&s.roleService.product.Create&&(!(s.roleService==null||s.roleService.product==null)&&s.roleService.product.Edit)?4:-1),f(),D(!(s.roleService==null||s.roleService.global==null)&&s.roleService.global.Export?5:-1),f(),D(s.roleService.product!=null&&s.roleService.product.Create?6:-1),f(7),M("data",s.data())("infiniteList",s.infiniteList)("pageData",s.pageData())("maskingFields",s.maskingFields),f(3),D(s.infiniteList.length>0?16:-1))},dependencies:[Ei,tn,li,Vi,Ri,$o,Xr,Co,Il,k1,tl,Y2,W2,xc,Pd],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}@media(max-width:575.98px){.table-responsive[_ngcontent-%COMP%]{font-size:.8rem}.table-responsive[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{min-width:640px}}"]})};var Fd=class o{constructor(c,a){this.data=c;this.dialogRef=a;this.modalConfig=new K1,this.modalConfig.title=c.title,this.modalConfig.headerType=Zi.Error}data;dialogRef;modalConfig;onOk(){this.dialogRef.close("REMOVE")}static \u0275fac=function(a){return new(a||o)(se($1),se(X1))};static \u0275cmp=nt({type:o,selectors:[["POS-modal-confirm-remove"]],standalone:!1,decls:7,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"section-content",2,"width","100%"],[1,"row"],[1,"col-sm-12"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),d(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"h5"),v(6),p()()()()()()),a&2&&(M("config",l.modalConfig),f(6),Ae(l.data.message))},dependencies:[Xo],encapsulation:2})};function Vd(o,c){return Array.isArray(o)?o.flatMap(a=>(a?.events??[]).map(l=>({id:l?.id,title:b_(l,c),description:l?.details??void 0,timestamp:l?.timestamp,meta:{CreatorName:l?.actor?.name??""},state:"completed"}))):[]}function b_(o,c){let a=o?.title?.trim();if(a)return a;let l=o?.action??"";return c[l]??l}var Rd=class o{data=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-additional-information"]],inputs:{data:[1,"data"]},standalone:!1,decls:17,vars:6,consts:[[1,"row","m-0","p-0"],[1,"col-6","mb-6"],[1,"mb-2"],[1,"form-control","info-display"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"label",2),v(3,"Release Date"),p(),d(4,"div",3),v(5),F(6,"date"),p()(),d(7,"div",1)(8,"label",2),v(9,"Cost Currency"),p(),d(10,"div",3),v(11),p()(),d(12,"div",1)(13,"label",2),v(14,"Cross Sell Product"),p(),d(15,"div",3),v(16),p()()()),a&2&&(f(5),oe(" ",Ie(6,3,l.data().Product.Released,"dd MMM yyyy")," "),f(6),oe(" ",l.data().ProductCurrency.CostCurrencySymbol+" - "+l.data().ProductCurrency.CostCurrencyName," "),f(5),oe(" ",l.data().Product.NextProductName," "))},dependencies:[Vn],styles:["label[_ngcontent-%COMP%]{font-size:.813rem}.info-display[_ngcontent-%COMP%]{height:2.375rem;padding:.375rem .75rem;font-size:.75rem;border:1px solid #dee2e6;border-radius:.25rem;background:#fff;color:#495057;display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]})};var Od=class o{description=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-description"]],inputs:{description:[1,"description"]},standalone:!1,decls:3,vars:2,consts:[[1,"row","m-0","p-0"],[1,"col-12"],["labelValue","Description","inputType","textarea",3,"inputValue","labelVisible"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1),G(2,"lib-info-page-input",2),p()()),a&2&&(f(2),M("inputValue",l.description())("labelVisible",!1))},dependencies:[il],encapsulation:2})};function C_(o,c){o&1&&(G(0,"i",5),d(1,"span",6),v(2,"Description"),p())}function y_(o,c){o&1&&(G(0,"i",7),d(1,"span",6),v(2,"More Settings"),p())}var Ud=class o{data=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-product-nav-tab"]],inputs:{data:[1,"data"]},standalone:!1,decls:9,vars:3,consts:[[1,"info-product-tab",3,"mat-stretch-tabs"],["mat-tab-label",""],[1,"mt-10"],[3,"description"],[3,"data"],[1,"fa-solid","fa-text","me-3","pb-1"],[1,"fs-5"],[1,"fa-solid","fa-circle-info","me-3","pb-1"]],template:function(a,l){a&1&&(d(0,"mat-tab-group",0)(1,"mat-tab"),_i(2,C_,3,0,"ng-template",1),d(3,"div",2),G(4,"POS-info-product-description",3),p()(),d(5,"mat-tab"),_i(6,y_,3,0,"ng-template",1),d(7,"div",2),G(8,"POS-info-product-additional-information",4),p()()()),a&2&&(M("mat-stretch-tabs",!1),f(4),M("description",l.data().Product.Description),f(4),M("data",l.data()))},dependencies:[U2,Q2,j2,Rd,Od],styles:["mat-tab-group.info-product-tab mat-tab-header{border-bottom:1px solid #e0e0e0}"]})};var I_=()=>["/menu/Products/Log/Product_History"],of=o=>({ProductID:o}),k_=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],D_=()=>["/menu/Reports/Purchases_Report/History"],M_=()=>["/menu/Products/Catalog/Products/Form"],lf=o=>({ID:o}),E_=()=>["/menu/Products/Catalog/Products/Inventory"],T_=o=>({"text-decoration":o}),P_=()=>["/menu/Products/Catalog/Variants/Info"],B_=(o,c)=>c.key;function N_(o,c){if(o&1&&(d(0,"div",1)(1,"a",52),G(2,"i",53),v(3," Sales History"),p(),G(4,"button",54),d(5,"ul",55)(6,"li")(7,"a",56),v(8,"Purchase History "),p()()()()),o&2){let a,l,s=x(2);f(),M("routerLink",ft(4,k_))("queryParams",ot(5,of,(a=s.data())==null||a.Product==null?null:a.Product.ID)),f(6),M("routerLink",ft(7,D_))("queryParams",ot(8,of,(l=s.data())==null||l.Product==null?null:l.Product.ID))}}function F_(o,c){if(o&1&&(d(0,"a",3),G(1,"i",57),v(2," Edit"),p()),o&2){let a,l=x(2);M("routerLink",ft(2,M_))("queryParams",ot(3,lf,(a=l.data())==null||a.Product==null?null:a.Product.ID))}}function V_(o,c){if(o&1){let a=Se();d(0,"a",58),de("click",function(){U(a);let s=x(2);return Q(s.removeProduct())}),G(1,"i",59),v(2," Delete"),p()}}function R_(o,c){if(o&1){let a=Se();d(0,"i",60),de("click",function(){U(a);let s=x(2);return Q(s.switchProductCodeType())}),p()}if(o&2){let a=x(2);M("matTooltip",a.variantColumnDisplayService.productCodeType()==="code"?"Hide Hexacode":"Display code in Hexadecimal format instead of ASCII for RFID Encoding")}}function O_(o,c){o&1&&(d(0,"div",16)(1,"label",18),v(2,"Hexacode"),p()())}function U_(o,c){if(o&1&&(d(0,"div",16)(1,"div",17),v(2),p()()),o&2){let a=x(2);f(2),oe(" ",a.data().Product.Hexacode," ")}}function Q_(o,c){if(o&1){let a=Se();d(0,"div")(1,"label",18),v(2,"Product Image"),p(),d(3,"POS-info-product-image-upload",61),de("imagesChange",function(s){U(a);let m=x(2);return Q(m.onImagesChange(s))}),p()()}if(o&2){let a=x(2);f(3),M("images",a.productImages)("maxFile",a.maxFile)("cloudinaryFolder",a.data().CloudinaryFolder)("productID",a.data().Product.ID)}}function j_(o,c){if(o&1&&(d(0,"div",22),v(1),p()),o&2){let a=x(2);M("matTooltip",a.maskingFieldMsg),f(),oe(" ",a.data().Product.SupplierName," ")}}function L_(o,c){if(o&1){let a=Se();d(0,"div",19),de("click",function(){U(a);let s=x(2);return Q(s.goToSupplierInfo(s.data().Product.SupplierID))}),v(1),p()}if(o&2){let a=x(2);f(),oe(" ",a.data().Product.SupplierName," ")}}function H_(o,c){if(o&1&&(d(0,"span",62),F(1,"date"),v(2),p()),o&2){let a=c.$implicit;M("matTooltip",Ie(1,2,a.Released,"dd MMM yyyy")),f(2),oe(" ",a.Name," ")}}function q_(o,c){if(o&1&&Jt(0,H_,3,5,"span",62,vi),o&2){let a=x(2);Kt(a.data().Form.Tags)}}function G_(o,c){o&1&&(d(0,"span",66),v(1,"*"),p())}function z_(o,c){if(o&1){let a=Se();d(0,"li",35)(1,"div",63),de("click",function(s){return s.stopPropagation()}),d(2,"p-checkbox",64),je("ngModelChange",function(s){let m=U(a).$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),de("onChange",function(){let s=U(a).$implicit,m=x(2);return Q(m.variantColumnDisplayService.toggleColumn(s.key))}),p(),d(3,"label",65),v(4),p(),k(5,G_,2,0,"span",66),p()()}if(o&2){let a=c.$implicit;f(2),Le("ngModel",a.selected),M("binary",!0)("inputId","col-"+a.key),f(),M("for","col-"+a.key),f(),oe(" ",a.name??a.key," "),f(),D(a.advanced?5:-1)}}function Y_(o,c){if(o&1&&(d(0,"a",36),v(1,"Outlet Inventory"),p()),o&2){let a=x(2);M("routerLink",ft(2,E_))("queryParams",ot(3,lf,a.data().Product.ID))}}function W_(o,c){if(o&1){let a=Se();d(0,"i",60),de("click",function(){U(a);let s=x(3);return Q(s.toggleVariantHexacodeColumn())}),p()}if(o&2){let a=x(3);M("matTooltip",a.variantColumnDisplayService.productCodeType()==="code"?"Hide Hexacode":"Display code in Hexadecimal format instead of ASCII for RFID Encoding")}}function J_(o,c){if(o&1&&(d(0,"th",41)(1,"div",28)(2,"div"),v(3),p(),k(4,W_,1,1,"i",15),p()()),o&2){let a=x(2);f(3),oe(" ",a.variantColumnDisplayService.columnsToDisplay.Code.name," "),f(),D(a.hasHexacodeVariant?4:-1)}}function K_(o,c){if(o&1&&(d(0,"th",42),v(1),p()),o&2){let a=x(2);f(),oe(" ",a.variantColumnDisplayService.columnsToDisplay.Hexacode.name," ")}}function X_(o,c){o&1&&(d(0,"th",43),v(1," Buying Cost "),p())}function $_(o,c){o&1&&(d(0,"th",43),v(1," Selling Price "),p())}function Z_(o,c){o&1&&(d(0,"th",44),v(1," % "),p())}function e6(o,c){o&1&&(d(0,"th",45),v(1," Minimum Price "),p())}function t6(o,c){o&1&&(d(0,"th",46),v(1," Weight (gr) "),p())}function i6(o,c){o&1&&(d(0,"th",46),v(1," Inventory "),p())}function n6(o,c){o&1&&(d(0,"th",47),v(1,"Ratio"),p())}function a6(o,c){o&1&&(d(0,"th",48),v(1," Reference "),p())}function r6(o,c){if(o&1){let a=Se();d(0,"button",76),de("click",function(s){U(a);let m=x(2).$implicit;return x(2).onRemove(m.ID),Q(s.stopPropagation())}),v(1," \xD7 "),p()}}function o6(o,c){if(o&1){let a=Se();d(0,"div",69)(1,"img",74),de("click",function(s){U(a);let m=x().$implicit,h=x(2);return Q(h.openBigPicture(m.Image,s))}),p(),k(2,r6,2,0,"button",75),p()}if(o&2){let a=x().$implicit,l=x(2);f(),M("src",a.Image,vl),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.ImageEditor?2:-1)}}function l6(o,c){if(o&1){let a=Se();d(0,"div",77),de("click",function(){U(a);let s=x().$implicit,m=x(2);return Q(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.ImageEditor?m.onAddImageModal(s.ID):null)}),G(1,"i",78),p()}if(o&2){let a=x(3);Kl("cursor",!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.ImageEditor?"pointer":"not-allowed")}}function s6(o,c){if(o&1&&(d(0,"td")(1,"span"),v(2),p()()),o&2){let a=x().$implicit;f(2),Ae(a.Code)}}function c6(o,c){if(o&1&&(d(0,"td")(1,"span"),v(2),p()()),o&2){let a=x().$implicit;f(2),Ae(a.Hexacode)}}function d6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitCost)," ")}}function p6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPrice)," ")}}function m6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPriceMinimum)," ")}}function f6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.PriceDiscount)," ")}}function u6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.Weight)," ")}}function v6(o,c){if(o&1&&(d(0,"td",73),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.Inventory)," ")}}function g6(o,c){if(o&1&&(d(0,"td",73),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.RatioDisplay)}}function b6(o,c){if(o&1&&(d(0,"td",73),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.BaseUnitName," ")}}function h6(o,c){if(o&1&&(d(0,"tr")(1,"td",67)(2,"div",68),k(3,o6,3,2,"div",69)(4,l6,2,2,"div",70),d(5,"div",67)(6,"a",71),v(7),p(),d(8,"small",72)(9,"i"),v(10),p()()()()(),k(11,s6,3,1,"td"),k(12,c6,3,1,"td"),k(13,d6,3,3,"td",73),k(14,p6,3,3,"td",73),k(15,m6,3,3,"td",73),k(16,f6,3,3,"td",73),k(17,u6,3,3,"td",73),k(18,v6,3,3,"td",73),k(19,g6,2,1,"td",73),k(20,b6,2,1,"td",73),p()),o&2){let a=c.$implicit,l=x(2);f(),Os(ot(19,T_,a.Discontinued?"line-through":"none")),hr("bg-gradient-warning",a.Discontinued),f(2),D(a.Image&&a.Image.trim()!==""?3:4),f(3),M("routerLink",ft(21,P_))("queryParams",ot(22,lf,a.ID)),f(),oe("",a.Model," "),f(3),Ae(a.VariantType),f(),D(l.variantColumnDisplayService.columnsToDisplay.Code.selected?11:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Hexacode.selected?12:-1),f(),D(l.roleService.product!=null&&l.roleService.product.Cost&&l.variantColumnDisplayService.columnsToDisplay.UnitCost.selected?13:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible&&l.variantColumnDisplayService.columnsToDisplay.UnitPrice.selected?14:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible&&l.variantColumnDisplayService.columnsToDisplay.PriceMin.selected?15:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Percentage.selected?16:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Weight.selected?17:-1),f(),D(l.roleService.inventory!=null&&l.roleService.inventory.View&&l.variantColumnDisplayService.columnsToDisplay.Inventory.selected?18:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.Ratio.selected?19:-1),f(),D(l.variantColumnDisplayService.columnsToDisplay.ReferenceUnit.selected?20:-1)}}function x6(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",0)(1,"actions"),k(2,N_,9,10,"div",1),d(3,"div",2),k(4,F_,3,5,"a",3),k(5,V_,3,0,"a",4),p()(),d(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"div",13)(16,"div")(17,"div",14)(18,"label"),v(19," Code "),p(),k(20,R_,1,1,"i",15),p()(),k(21,O_,3,0,"div",16),p(),d(22,"div",13)(23,"div")(24,"div",17),v(25),p()(),k(26,U_,3,1,"div",16),p()(),d(27,"div",12)(28,"label",18),v(29,"Category"),p(),d(30,"div",19),de("click",function(){U(a);let s=x();return Q(s.goToCategoryInfo(s.data().Product.CategoryID))}),v(31),p()()(),k(32,Q_,4,4,"div"),p()()()(),d(33,"div",20)(34,"div",8)(35,"div",9)(36,"div",21)(37,"div")(38,"label",18),v(39,"Supplier"),p(),k(40,j_,2,2,"div",22)(41,L_,2,1,"div",23),p(),d(42,"div")(43,"label",18),v(44,"Brand"),p(),d(45,"div",17),v(46),p()(),d(47,"div")(48,"label",18),v(49,"Tags"),p(),d(50,"div",24),k(51,q_,2,0),p()(),d(52,"div")(53,"label",18),v(54,"Status"),p(),d(55,"div",17),v(56),p()()()()()()(),d(57,"div",6)(58,"div",25)(59,"div",26)(60,"div",27)(61,"div",28)(62,"h3",29),v(63,"Pricing & Variants"),p(),d(64,"div",30)(65,"div",31),G(66,"i",32),p(),d(67,"ul",33)(68,"div",34)(69,"h6"),v(70,"Columns to View"),p()(),Jt(71,z_,6,6,"li",35,B_),p()()(),d(73,"div",1),k(74,Y_,2,5,"a",36),p()(),d(75,"div",9)(76,"div",37)(77,"table",38)(78,"thead",39)(79,"tr")(80,"th",40),v(81,"Variant"),p(),k(82,J_,5,2,"th",41),k(83,K_,2,1,"th",42),k(84,X_,2,0,"th",43),k(85,$_,2,0,"th",43),k(86,Z_,2,0,"th",44),k(87,e6,2,0,"th",45),k(88,t6,2,0,"th",46),k(89,i6,2,0,"th",46),k(90,n6,2,0,"th",47),k(91,a6,2,0,"th",48),p()(),d(92,"tbody"),Jt(93,h6,21,24,"tr",null,vi),p()()()()()()(),d(95,"div",13)(96,"div",25)(97,"div",49)(98,"div",9),G(99,"POS-info-product-nav-tab",50),p()()()(),d(100,"div",13)(101,"div",25),G(102,"POS-timeline",51),p()()()()()}if(o&2){let a,l,s,m=x();M("pageData",m.menuData())("hideSearchDropdown",!0)("hideSearchBox",!0)("tooltipTitle",(a=m.data())==null||a.Form==null?null:a.Form.Name),f(2),D(m.roleService.report.View?2:-1),f(2),D(m.roleService.product.Edit?4:-1),f(),D(m.roleService.product.Delete?5:-1),f(11),Jo(m.variantColumnDisplayService.productCodeType()==="code"?"col-12 pe-5":"col-6 pe-2"),f(4),D(m.data().Product.Hexacode?20:-1),f(),D(m.variantColumnDisplayService.productCodeType()==="hexacode"?21:-1),f(2),Jo(m.variantColumnDisplayService.productCodeType()==="code"?"col-12 pe-5":"col-6 pe-2"),f(2),oe(" ",m.data().Product.Code," "),f(),D(m.variantColumnDisplayService.productCodeType()==="hexacode"?26:-1),f(5),oe(" ",m.data().Form.Name," "),f(),D(m.roleService.product.ImageEditor||!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit||(!m.roleService.product.ImageEditor||!(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit))&&m.productImages.length>0?32:-1),f(8),D(m.maskingFields.SupplierName&&!m.roleService.global.SensitiveField?40:41),f(6),oe(" ",m.data().Product.Brand," "),f(5),D(m.data().Form.Tags?51:-1),f(4),hr("text-danger",m.data().Product.Discontinued),f(),oe(" ",m.data().Product.Discontinued?"Discontinued":"Active"," "),f(15),Kt(m.variantColumnDisplayService.getAvailableColumns()),f(3),D(m.roleService.inventory.View?74:-1),f(8),D(m.variantColumnDisplayService.columnsToDisplay.Code.selected?82:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Hexacode.selected?83:-1),f(),D(m.roleService.product!=null&&m.roleService.product.Cost&&m.variantColumnDisplayService.columnsToDisplay.UnitCost.selected?84:-1),f(),D(m.roleService.sell!=null&&m.roleService.sell.PriceVisible&&m.variantColumnDisplayService.columnsToDisplay.UnitPrice.selected?85:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Percentage.selected?86:-1),f(),D(m.roleService.sell!=null&&m.roleService.sell.PriceVisible&&m.variantColumnDisplayService.columnsToDisplay.PriceMin.selected?87:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Weight.selected?88:-1),f(),D(m.roleService.inventory!=null&&m.roleService.inventory.View&&m.variantColumnDisplayService.columnsToDisplay.Inventory.selected?89:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.Ratio.selected?90:-1),f(),D(m.variantColumnDisplayService.columnsToDisplay.ReferenceUnit.selected?91:-1),f(2),Kt(m.data().Variant),f(6),M("data",m.data()),f(3),M("viewLink",ft(39,I_))("queryParams",ot(40,of,(l=m.data())==null||l.Product==null?null:l.Product.ID))("items",m.timelineData)("created",((s=m.data())==null||s.DocumentInfo==null?null:s.DocumentInfo.Created)??null)}}var _6={Create:"Created",Update:"Updated"},Qd=class o extends Cd{constructor(a,l,s,m,h,_,w,A){super(a,l,"catalog/ProductLoader/ProductInfoInitial",s);this.httpService=l;this.activatedRoute=s;this.router=m;this.toaster=h;this.matDialog=_;this.title=w;this.roleService=A;this.variantColumnDisplayService.resetCodeTypes(),this.destroy$=new ps}httpService;activatedRoute;router;toaster;matDialog;title;roleService;formVariantV2Service=dn(_d);variantColumnDisplayService=dn(dg);maxFile=5;timelineData=[];timelineLoading=!1;bigPicture=dn(vs);destroy$;redirect;productImages=[];ratioConfig;maskingFields;maskingFieldMsg=T2.maskingField;showMainImageOverlay=!0;initRoles(){this.ratioConfig=this.data()?.Variant?.filter(a=>a.TypeID==7).length>0}get isMultipleUOM(){return this.data()?.Product?.VariantTypeID===7}get hasHexacodeVariant(){return(this.data()?.Variant??[]).some(a=>!Qi.IsEmpty(a.Hexacode))}postBindData(){Qi.IsNotEmpty(this.data()?.Product?.Hexacode)&&this.variantColumnDisplayService.resetCodeTypes("hexacode"),this.menuData().H=this.data().PageTitle,this.maskingFields=Qi.generateMaskingField(this.data().MaskFields);let a=this.title.getTitle().split("|")[0],l=this.data().Product.Name;this.title.setTitle(`${a}| ${l}`),this.productImages=this.data().ProductImages,this.initRoles(),this.fetchProductTimeline()}fetchProductTimeline(){let a=this.data()?.Product?.ID;a&&(this.timelineLoading=!0,this.httpService.get(`/API/catalog/Product/timeline/${a}`).subscribe({next:l=>{this.timelineData=Vd(l?.Data,_6),this.timelineLoading=!1},error:()=>{this.timelineData=[],this.timelineLoading=!1}}))}uploadEditedImage(){let a=this.sliceImageUrl(),l={ID:this.data().Product.ID,ImageUrl:this.productImages[0]?this.productImages[0].URL:"",ProductImages:a};this.httpService.post(Da.UpdateProductImage,l).subscribe(s=>{this.toaster.success("Image has been updated",Zi.Success),this.productImages=s.ProductImages})}sliceImageUrl(){return this.productImages.map(a=>{let l="";return a.URL.includes("crop")&&(l=a.URL.split("upload/")[1].split(`/${this.data().CloudinaryConfig}`)[0]+"#"),a.URL=l+a.URL.substring(a.URL.lastIndexOf("/")+1),a})}onRemoveImage(a=-1,l){l?.stopPropagation(),this.matDialog.open(Fd,{data:{message:"Are you sure you want to delete this image?",title:"Confirm Delete"},width:"335px"}).afterClosed().subscribe(s=>{s=="REMOVE"&&(a!=-1&&(this.productImages=this.productImages.filter((m,h)=>h!=a)),this.uploadEditedImage())})}onEditImage(a,l,s){s.stopPropagation();let m=a.split(`/${this.data().CloudinaryConfig}`)[1],h=this.data().CloudinaryConfig+m.split(".")[0],_=`.${m.split(".")[1]}`}uploadPicture(){}removeProduct(){confirm("Are you sure you want to delete this record?")&&(this.redirect=!0,this.data().Form={ID:this.data().Product.ID},this.httpService.post("/API/catalog/product/DeleteProductInfo",this.data().Form).subscribe({next:()=>{let l=`${this.data()?.PageTitle} has been deleted successfully.`;this.onDeleteSuccess(l)}}))}onDeleteSuccess(a){let l;this.redirect?(l=a,this.router.navigate(["/menu/Products/Catalog/Products"])):l="Image success change",this.toaster.success(l,Zi.Success)}drop(a){G2(this.productImages,a.previousContainer.data,a.container.data),this.uploadEditedImage()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}goToCategoryInfo(a){this.maskingFields.Category&&this.roleService.global.SensitiveField||this.router.navigate(["/menu/Products/Catalog/Categories/Info"],{queryParams:{ID:a}})}goToSupplierInfo(a){!(this.maskingFields.SupplierName&&!this.roleService.global.SensitiveField)&&Qi.IsNotEmpty(a)&&this.router.navigate(["/menu/Contacts/Contact/Suppliers/Info/V2"],{queryParams:{ID:a}})}onImagesChange(a){this.productImages=a,this.uploadEditedImage()}openBigPicture(a,l){this.bigPicture.openBiggerPicture(l,a)}onRemove(a){this.data().Variant=this.data().Variant.map(l=>l.ID===a?Fo(kr({},l),{Image:""}):l),this.formVariantV2Service.deleteImage(a).subscribe(l=>{this.toaster.success(l.Message,Zi.Success)})}onAddImageModal(a){console.log("VariantID",a);let l=`${this.data().CloudinaryFolderVariant}/${a}`;this.matDialog.open(Ml,{data:{currentProductImagesLength:0,CloudinaryFolder:l,maxNumberOfFiles:1}}).afterClosed().subscribe(m=>{this.onImageUpdated(m,a),this.data().Variant=this.data().Variant.map(h=>h.ID===a?(console.log("result",m),Fo(kr({},h),{Image:m[0].ImageURL})):h)})}onImageUpdated(a,l){this.formVariantV2Service.updateImage(l,a[0].ImageName).subscribe(s=>{s&&this.toaster.success(s.Message,Zi.Success)})}switchProductCodeType(){this.variantColumnDisplayService.productCodeType.update(a=>a==="code"?"hexacode":"code")}toggleVariantHexacodeColumn(){this.variantColumnDisplayService.toggleColumn("Hexacode")}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(Jn),se(ir),se(zi),se(Ma),se(dc),se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-product"]],standalone:!1,features:[$i],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox","tooltipTitle"],[1,"btn-group"],[1,"btn-group","ms-5"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["role","button",1,"btn","btn-outline-secondary"],[1,"container-fluid","bg-light-gray","pt-8"],[1,"row","mb-10"],[1,"col-md-8","d-flex","flex-column"],[1,"card","h-100","mb-0"],[1,"card-body"],[1,"d-flex","flex-column","gap-10"],[1,"row","g-3"],[1,"col-6"],[1,"row"],[1,"d-flex","gap-2","align-items-center","mb-2"],["matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-hexagon-plus","cursor",3,"matTooltip"],[1,"col-6","pe-6","ps-1"],[1,"form-control","info-display"],[1,"mb-2"],[1,"form-control","info-display","info-display--link",3,"click"],[1,"col-md-4","ps-3","d-flex","flex-column"],[1,"d-flex","flex-column","gap-6"],["matTooltipPosition","below",1,"form-control","info-display",3,"matTooltip"],[1,"form-control","info-display","info-display--link"],[1,"form-control","info-tags"],[1,"col-12"],[1,"card","mb-0"],[1,"card-header","d-flex","justify-content-between"],[1,"d-flex","gap-2","align-items-center"],[1,"mb-0"],[1,"dropdown"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"p-0","d-flex","justify-content-center","align-items-center",2,"cursor","pointer"],["matTooltip","Toggle columns","matTooltipPosition","above",1,"fa-solid","fa-columns-3","position-relative","mb-0","column","column-toggler"],[1,"dropdown-menu","dropdown-menu-start","mt-2"],[1,"border-bottom","pb-3","px-3"],[1,"column-toggle-group"],["role","button","matTooltipPosition","above","matTooltip","Send Delivery",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"table-responsive","horizontal-scroll"],[1,"table","table-bordered"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","200px"],[1,"border-end",2,"width","150px"],[1,"border-end","text-end",2,"width","150px"],[1,"border-end","text-end",2,"width","50px"],[1,"border-end","text-end",2,"width","120px"],[1,"border-end","text-end",2,"width","100px"],[1,"border-end",2,"width","25px"],[1,"border-end",2,"width","140px"],[1,"card"],[3,"data"],["variant","compact",3,"viewLink","queryParams","items","created"],["role","button",1,"btn","btn-outline-secondary","border-end-0",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-chart-bar"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],["role","button",1,"dropdown-item",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],["matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-hexagon-plus","cursor",3,"click","matTooltip"],[3,"imagesChange","images","maxFile","cloudinaryFolder","productID"],["matTooltipPosition","below",1,"bg-secondary",3,"matTooltip"],["matTooltipPosition","above",1,"p-4",3,"click"],[1,"me-3",3,"ngModelChange","onChange","ngModel","binary","inputId"],[1,"cursor-pointer",2,"width","70%",3,"for"],[1,"text-danger","ms-3"],[1,"d-flex","flex-column"],[1,"d-flex","gap-3"],[1,"position-relative","thumbnail-image-wrapper"],[1,"d-flex","justify-content-center","align-items-center","image-uploader",3,"cursor"],[3,"routerLink","queryParams"],[2,"line-height","1"],[1,"text-end"],["brokenImageIconFailSafe","",2,"width","41.33px","cursor","pointer","object-fit","cover",3,"click","src"],["type","button","aria-label","Remove image",1,"thumbnail-remove-btn"],["type","button","aria-label","Remove image",1,"thumbnail-remove-btn",3,"click"],[1,"d-flex","justify-content-center","align-items-center","image-uploader",3,"click"],[1,"fa-light","fa-image-circle-plus",2,"color","#9ca3af"]],template:function(l,s){if(l&1&&k(0,x6,103,42,"mainpanel-cmp",0),l&2){let m;D((m=s.data())!=null&&m.Product?0:-1)}},dependencies:[gs,Ei,tn,li,Vi,Ri,X2,kl,wc,Ud,Li,Vn],styles:["@media(min-width:992px){.product-info-row[_ngcontent-%COMP%]{height:467.6px}}label[_ngcontent-%COMP%]{font-size:.813rem}.info-display[_ngcontent-%COMP%]{height:2.375rem;padding:.375rem .75rem;font-size:.75rem;border:1px solid #dee2e6;border-radius:.25rem;background:#fff;color:#495057;display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.info-display--link[_ngcontent-%COMP%]{color:#0976b4;cursor:pointer}.info-tags[_ngcontent-%COMP%]{min-height:2.375rem;height:auto;padding:.375rem .75rem;font-size:.75rem;border:1px solid #dee2e6;border-radius:.25rem;background:#fff;display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px;overflow-y:auto;max-height:50vh}.column-toggler[_ngcontent-%COMP%]{cursor:pointer}.horizontal-scroll[_ngcontent-%COMP%]{overflow-x:auto;overflow-y:hidden}.horizontal-scroll[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{min-width:max-content}.thumbnail-image-wrapper[_ngcontent-%COMP%] .thumbnail-remove-btn[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;border:none;background:#dc2626d9;color:#fff;font-size:.75rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s}.thumbnail-image-wrapper[_ngcontent-%COMP%]:hover .thumbnail-remove-btn[_ngcontent-%COMP%]{opacity:1}.image-uploader[_ngcontent-%COMP%]{width:41.33px;height:41.33px;cursor:pointer;background-color:#fafafa;border:1.5px dashed #d1d5db;border-radius:4px}"]})};var C6=()=>["/menu/Products/Log/Variant_History"],y6=()=>["Form"],w6=o=>({"text-decoration-line-through":o}),Mg=()=>["/menu/Products/Catalog/Variants/Info"],Eg=o=>({ID:o}),Tg=o=>({width:o});function A6(o,c){if(o&1){let a=Se();d(0,"a",11),de("click",function(){U(a);let s=x(2);return Q(s.httpPostListID("catalog/variant/DeleteVariantList"))}),G(1,"i",12),v(2," Delete "),p()}}function S6(o,c){o&1&&(d(0,"a",4),G(1,"i",13),v(2," Update History "),p()),o&2&&M("routerLink",ft(1,C6))}function I6(o,c){if(o&1){let a=Se();d(0,"button",14),de("click",function(){U(a);let s=x(2);return Q(s.openExportModal())}),G(1,"i",15),v(2," Export "),p()}}function k6(o,c){o&1&&(d(0,"a",6),v(1," Add "),p()),o&2&&M("routerLink",ft(1,y6))}function D6(o,c){if(o&1&&(d(0,"div",28)(1,"span",29),v(2),p(),d(3,"span",30),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function M6(o,c){if(o&1&&(d(0,"div",28)(1,"span",29),v(2),p(),d(3,"span",30),v(4),p()()),o&2){let a=c.item;f(2),Ae(a.Symbol),f(2),Ae(a.Value)}}function E6(o,c){if(o&1){let a=Se();d(0,"div",16)(1,"div",17)(2,"h6"),v(3,"Category"),p(),d(4,"POS-product-category-select",18),je("selectedCategoryIDChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.CategoryID,s)||(m.pageData().Filter.CategoryID=s),Q(s)}),p()(),d(5,"div",17)(6,"h6"),v(7,"Supplier"),p(),d(8,"autocompleteV2",19),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.SupplierID,s)||(m.pageData().Filter.SupplierID=s),Q(s)}),p()(),d(9,"div",17)(10,"h6"),v(11,"Brand"),p(),d(12,"POS-brand-options-v2",20),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.BrandIDs,s)||(m.pageData().Filter.BrandIDs=s),Q(s)}),p()(),d(13,"div",17)(14,"h6"),v(15,"Type"),p(),d(16,"ng-select",21),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.TypeID,s)||(m.pageData().Filter.TypeID=s),Q(s)}),p()(),d(17,"div",17)(18,"h6"),v(19,"Cost Currency"),p(),d(20,"ng-select",21),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.VariantCostCurrencyID,s)||(m.pageData().Filter.VariantCostCurrencyID=s),Q(s)}),_i(21,D6,5,2,"ng-template",22)(22,M6,5,2,"ng-template",23),p()(),d(23,"div",17)(24,"h6"),v(25,"Outlet Inventory"),p(),d(26,"outlet-selector",24),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.EntityID,s)||(m.pageData().Filter.EntityID=s),Q(s)}),p()(),d(27,"div",17)(28,"h6"),v(29,"Discontinued"),p(),d(30,"radio-options",25),je("modelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.Discontinued,s)||(m.pageData().Filter.Discontinued=s),Q(s)}),p()(),d(31,"div",17)(32,"h6"),v(33,"Order By"),p(),d(34,"radio-options",26),je("modelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.OrderBy,s)||(m.pageData().Filter.OrderBy=s),Q(s)}),p()(),d(35,"div",17)(36,"h6"),v(37,"Order Direction"),p(),d(38,"radio-options",27),je("modelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.OrderByDirection,s)||(m.pageData().Filter.OrderByDirection=s),Q(s)}),p()()()}if(o&2){let a,l,s=x(2);f(4),Le("selectedCategoryID",s.pageData().Filter.CategoryID),M("showClear",!0),f(4),Le("ngModel",s.pageData().Filter.SupplierID),f(4),Le("ngModel",s.pageData().Filter.BrandIDs),M("multiple",!0)("placeholder","Choose Brand")("clearable",!0),f(4),M("items",(a=s.pageData().Options)==null?null:a.Types),Le("ngModel",s.pageData().Filter.TypeID),f(4),M("items",(l=s.pageData().Options)==null?null:l.CurrencyOptions),Le("ngModel",s.pageData().Filter.VariantCostCurrencyID),f(6),M("multiple",!1)("accessType",2),Le("ngModel",s.pageData().Filter.EntityID),f(4),M("options",s.discontinuedOption()),Le("model",s.pageData().Filter.Discontinued),f(4),M("options",s.pageData().Options.OrderByOptions),Le("model",s.pageData().Filter.OrderBy),f(4),M("options",s.pageData().Options.OrderByDirectionOptions),Le("model",s.pageData().Filter.OrderByDirection)}}function T6(o,c){if(o&1){let a=Se();d(0,"th",34)(1,"input",43),de("change",function(s){U(a);let m=x(3);return Q(m.onSelectAllData(s.target.checked))}),p()()}}function P6(o,c){o&1&&(d(0,"th",36),v(1,"Type"),p())}function B6(o,c){o&1&&(d(0,"th",36),v(1,"Code"),p())}function N6(o,c){o&1&&(d(0,"th",37),v(1,"Description"),p())}function F6(o,c){o&1&&(d(0,"th",38),v(1,"Buying Cost"),p())}function V6(o,c){o&1&&(d(0,"th",38),v(1,"Last Buy Cost"),p())}function R6(o,c){o&1&&(d(0,"th",39),v(1," Selling Price "),p())}function O6(o,c){o&1&&(d(0,"th",40),v(1,"%"),p())}function U6(o,c){o&1&&(d(0,"th",41),v(1," Inventory "),p())}function Q6(o,c){if(o&1){let a=Se();d(0,"td",34)(1,"input",53),je("ngModelChange",function(s){U(a);let m=x().$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),p()()}if(o&2){let a=x().$implicit;f(),Le("ngModel",a.selected)}}function j6(o,c){if(o&1){let a=Se();d(0,"img",54),de("click",function(s){U(a);let m=x().$implicit,h=x(3);return Q(h.openBiggerPicture(m,s))}),p()}if(o&2){let a=x().$implicit,l=x(3);Os(ot(5,Tg,l.data().ThumbnailWidth+"px")),M("src",a.ThumbnailUrl,vl)("linkTarget",l.pageData().LinkTarget)("redirectUrl","/menu/Products/Catalog/Variants/Info/?ID="+a.ID)}}function L6(o,c){if(o&1&&(d(0,"a",47),G(1,"img",55),p()),o&2){let a=x().$implicit,l=x(3);M("routerLink",ft(5,Mg))("queryParams",ot(6,Eg,a.ID))("target",l.pageData().LinkTarget),f(),Os(ot(8,Tg,l.data().ThumbnailWidth+"px"))}}function H6(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.TypeLabel," ")}}function q6(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.Code)}}function G6(o,c){if(o&1&&G(0,"td",50),o&2){let a=x().$implicit;M("innerHTML",a.Description,W1)}}function z6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitCost)," ")}}function Y6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.OrderPrice)," ")}}function W6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPrice)," ")}}function J6(o,c){if(o&1&&(d(0,"td",52),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.PriceDiscount!=0?a.PriceDiscount:""," ")}}function K6(o,c){if(o&1&&(d(0,"td",51),v(1),F(2,"quantityFraction"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.OnHand)," ")}}function X6(o,c){if(o&1&&(d(0,"tr"),k(1,Q6,2,1,"td",34),d(2,"td")(3,"div",44)(4,"div",45),k(5,j6,1,7,"img",46),zl(6),k(7,L6,2,10,"a",47),Yl(),p(),d(8,"div",48)(9,"a",49),v(10),p()()()(),k(11,H6,2,1,"td"),k(12,q6,2,1,"td"),k(13,G6,1,1,"td",50),k(14,z6,3,3,"td",51),k(15,Y6,3,3,"td",51),k(16,W6,3,3,"td",51),k(17,J6,2,1,"td",52),k(18,K6,3,3,"td",51),p()),o&2){let a,l=c.$implicit,s=x(3);f(),D(s.roleService.product!=null&&s.roleService.product.Delete?1:-1),f(4),D(l.ImageUrl?5:-1),f(2),D(l.ImageUrl?-1:7),f(2),Jo(ot(17,w6,(l==null?null:l.IsDiscontinued)&&s.pageData().Filter.Discontinued==2)),M("routerLink",ft(19,Mg))("queryParams",ot(20,Eg,l.ID))("target",s.pageData().LinkTarget),f(),Ae(l.Name),f(),D(s.column().Type.selected?11:-1),f(),D(s.column().Code.selected?12:-1),f(),D(s.column().Description.selected?13:-1),f(),D(s.roleService.product!=null&&s.roleService.product.Cost&&s.column().BuyingCost.selected?14:-1),f(),D(s.roleService.product!=null&&s.roleService.product.Cost&&s.column().LastBuyCost.selected?15:-1),f(),D(s.roleService.sell!=null&&s.roleService.sell.PriceVisible&&s.column().SellingPrice.selected?16:-1),f(),D(s.roleService.sell!=null&&s.roleService.sell.Discount&&s.column().Discount.selected?17:-1),f(),D(s.roleService.inventory!=null&&s.roleService.inventory.View&&((a=s.column().Inventory)!=null&&a.selected)?18:-1)}}function $6(o,c){if(o&1){let a=Se();d(0,"table",31),de("matSortChange",function(s){U(a);let m=x(2);return Q(m.sortData(s))}),d(1,"thead",32)(2,"tr",33),k(3,T6,2,0,"th",34),d(4,"th",35),v(5,"Name"),p(),k(6,P6,2,0,"th",36),k(7,B6,2,0,"th",36),k(8,N6,2,0,"th",37),k(9,F6,2,0,"th",38),k(10,V6,2,0,"th",38),k(11,R6,2,0,"th",39),k(12,O6,2,0,"th",40),k(13,U6,2,0,"th",41),p()(),d(14,"tbody"),_i(15,X6,19,22,"tr",42),p()()}if(o&2){let a,l=x(2);f(3),D(l.roleService.product!=null&&l.roleService.product.Delete?3:-1),f(3),D(l.column().Type.selected?6:-1),f(),D(l.column().Code.selected?7:-1),f(),D(l.column().Description.selected?8:-1),f(),D(l.roleService.product!=null&&l.roleService.product.Cost&&l.column().BuyingCost.selected?9:-1),f(),D(l.roleService.product!=null&&l.roleService.product.Cost&&l.column().LastBuyCost.selected?10:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.PriceVisible&&l.column().SellingPrice.selected?11:-1),f(),D(l.roleService.sell!=null&&l.roleService.sell.Discount&&l.column().Discount.selected?12:-1),f(),D(l.roleService.inventory!=null&&l.roleService.inventory.View&&((a=l.column().Inventory)!=null&&a.selected)?13:-1),f(2),M("ngForOf",l.infiniteList)}}function Z6(o,c){if(o&1){let a=Se();d(0,"infinite-pagination",56),de("nextPage",function(){U(a);let s=x(2);return Q(s.NextPage(!0))})("fetchTotalData",function(){U(a);let s=x(2);return Q(s.StoreRowsCountAPIResult("catalog/variant/GetVariantListCount"))})("concatAllData",function(){U(a);let s=x(2);return Q(s.StoreRowsCountAPIResult("catalog/variant/GetVariantListCount",!0))}),p()}if(o&2){let a=x(2);M("totalData",a.listTotal())("totalCurrentRow",a.infiniteList==null?null:a.infiniteList.length)("pageNumber",a.pageData().Filter.PageNumber)("nextPageDisabled",a.nextPageDisabled())("isFetchTotalData",a.pageData().HideStoreApiCount)("goToLast",a.goToLast())("hasShowAllButton",!1)}}function e5(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",2),je("textChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter.Text,s)||(m.pageData().Filter.Text=s),Q(s)}),de("onSubmit",function(){U(a);let s=x();return Q(s.searchFromPageOne())}),je("filterChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter,s)||(m.pageData().Filter=s),Q(s)}),de("onChangeColumnCheckbox",function(){U(a);let s=x();return Q(s.checkForAdvancedColumn())}),d(1,"actions"),k(2,A6,3,0,"a",3),k(3,S6,3,2,"a",4),k(4,I6,3,0,"button",5),k(5,k6,2,2,"a",6),p(),d(6,"filters"),_i(7,E6,39,20,"ng-template",null,0,co),p(),d(9,"content")(10,"div",7)(11,"div",8),k(12,$6,16,10,"table",9),p(),k(13,Z6,1,7,"infinite-pagination",10),p()()()}if(o&2){let a=x();M("pageData",a.menuData()),Le("text",a.pageData().Filter.Text),M("isFilterOnDropdown",!1),Le("filter",a.pageData().Filter),M("column",a.column()),f(2),D(a.roleService.product.Delete&&a.getSelectedData().length>0?2:-1),f(),D(a.roleService.product!=null&&a.roleService.product.Edit?3:-1),f(),D(a.roleService.global!=null&&a.roleService.global.Export?4:-1),f(),D(a.roleService.product!=null&&a.roleService.product.Create?5:-1),f(7),D(a.data()?12:-1),f(),D(a.infiniteList.length>0?13:-1)}}var jd=class o extends fs{constructor(a,l,s,m,h,_){super(a,l,"catalog/variant/GetVariantList","catalog/VariantLoader/VariantList",s);this.httpService=l;this.csvConverter=m;this.roleService=h;this.matDialog=_}httpService;csvConverter;roleService;matDialog;columnService=dn(ld);bigPicture=dn(vs);column=Qe({Type:{selected:!0},Code:{selected:!0},Description:{selected:!1},BuyingCost:{selected:!0,name:"Buying Cost"},LastBuyCost:{selected:!1,name:"Last Buy Cost"},SellingPrice:{selected:!0,name:"Selling Price"},Discount:{selected:!1,name:"%"},Inventory:{selected:!0}});discontinuedOption=Qe([{Key:0,Value:"No"},{Key:1,Value:"Yes"},{Key:2,Value:"All"}]);more=Qe(!1);options=Qe([{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}]);isHasBrandRestriction=H1(()=>!!this.pageData().Filter.BrandIDs&&this.pageData().Filter.BrandIDs.length>0&&!this.brandIdSelectedChange());brandIdSelectedChange=Qe(!1);openExportModal(){this.matDialog.open(Kr,{data:{title:"Variant",exportTypes:[{ID:"ProductExport/VariantExport",Value:"Default",FileName:"Variant"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!0}})}sortData(a){let l=JSON.parse(JSON.stringify(this.originalData()));if(!a.active||a.direction===""){this.infiniteList=l;return}this.infiniteList=l.sort((s,m)=>{let h=a.direction==="asc";switch(a.active){case"Name":return Qi.compare(s.Name.toLocaleLowerCase(),m.Name.toLocaleLowerCase(),h);case"Price":return Qi.compare(s.UnitPrice,m.UnitPrice,h);case"Inventory":return Qi.compare(s.OnHand,m.OnHand,h);default:return 0}})}openBiggerPicture(a,l){this.bigPicture.openBiggerPicture(l,a.ImageUrl)}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column(),this.infiniteList,this.pageData().Filter)}onFilterBrand(a){this.pageData().Filter.BrandIDs=a,this.brandIdSelectedChange.set(!0)}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(zi),se(Z1),se(yi),se(Ma))};static \u0275cmp=nt({type:o,selectors:[["POS-variant"]],standalone:!1,features:[$i],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","text","isFilterOnDropdown","filter","column"],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["role","button","confirm-message","Are you sure you want to delete this record?",1,"btn","btn-outline-secondary","me-3"],["role","button",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","Add",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom"],[3,"totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast","hasShowAllButton"],["role","button","confirm-message","Are you sure you want to delete this record?",1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-trash"],["aria-hidden","true",1,"fa","fa-clock-rotate-left","me-2"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter","mt-3",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel","multiple","placeholder","clearable"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],["name","Discontinued",3,"modelChange","options","model"],["name","OrderBy",3,"modelChange","options","model"],["name","OrderDirection",3,"modelChange","options","model"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","14px"],["mat-sort-header","Name"],[2,"width","100px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["mat-sort-header","Price","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","50px"],["mat-sort-header","Inventory","arrowPosition","before",2,"width","85px"],[4,"ngFor","ngForOf"],["type","checkbox",3,"change"],[1,"d-flex","flex-row"],[2,"cursor","pointer"],["matTooltipPosition","above","matTooltip","Click to zoom","brokenImageIconFailSafe","",3,"src","style","linkTarget","redirectUrl"],[1,"d-block",3,"routerLink","queryParams","target"],[1,"ps-2","name-wrapper"],[1,"align-top",3,"routerLink","queryParams","target"],[3,"innerHTML"],[1,"text-end"],[1,"text-end",2,"color","red"],["type","checkbox",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom","brokenImageIconFailSafe","",3,"click","src","linkTarget","redirectUrl"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast","hasShowAllButton"]],template:function(l,s){l&1&&k(0,e5,14,11,"mainpanel-cmp",1),l&2&&D(s.pageData()&&s.data()?0:-1)},dependencies:[Ei,tn,D2,li,A1,Vi,Ri,$o,S1,I1,Co,Il,k1,Zo,tl,kl,Y2,W2,xc,Li,J2],styles:[".break-word[_ngcontent-%COMP%]{overflow-wrap:break-word;word-wrap:break-word}.category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}@media(max-width:575.98px){.table-responsive[_ngcontent-%COMP%]{font-size:.8rem}.table-responsive[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{min-width:640px}.table-responsive[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-responsive[_ngcontent-%COMP%] .name-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center}}"]})};var Ld=(l=>(l[l.PurchaseOrder=2]="PurchaseOrder",l[l.Archive=3]="Archive",l[l.LandedCost=6]="LandedCost",l))(Ld||{});var Pg=()=>["/menu/Products/Catalog/Variants/Info"],cf=o=>({ID:o}),t5=()=>["/menu/Products/Catalog/Variants"],i5=o=>[o];function n5(o,c){if(o&1){let a=Se();d(0,"button",11),de("click",function(){U(a);let s=x(2);return Q(s.openExportModal())}),G(1,"i",12),v(2," Export "),p()}}function a5(o,c){if(o&1&&(d(0,"a",4),v(1," Return to Variant "),p()),o&2){let a=x(2);M("routerLink",ft(2,Pg))("queryParams",ot(3,cf,a.data.Data[0]==null?null:a.data.Data[0].ParentID))}}function r5(o,c){o&1&&(d(0,"a",5),v(1," Return to Variant "),p()),o&2&&M("routerLink",ft(1,t5))}function o5(o,c){if(o&1){let a=Se();d(0,"div",13)(1,"div",14)(2,"h6"),v(3,"Outlet"),p(),d(4,"outlet-selector",15),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.EntityID,s)||(m.pageData.Filter.EntityID=s),Q(s)}),p()(),d(5,"div",14)(6,"h6"),v(7,"Variant"),p(),d(8,"autocompleteV2",16),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.VariantID,s)||(m.pageData.Filter.VariantID=s),Q(s)}),p()(),d(9,"div",14)(10,"h6"),v(11,"From Date"),p(),d(12,"datepicker",17),je("dateChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.From,s)||(m.pageData.Filter.From=s),Q(s)}),p()(),d(13,"div",14)(14,"h6"),v(15,"To Date"),p(),d(16,"datepicker",18),je("dateChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.To,s)||(m.pageData.Filter.To=s),Q(s)}),p()(),d(17,"div",14)(18,"h6"),v(19,"Note"),p(),d(20,"input",19),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.Note,s)||(m.pageData.Filter.Note=s),Q(s)}),p()(),d(21,"div",14)(22,"h6"),v(23,"Page Size"),p(),d(24,"input",20),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData.Filter.RowCount,s)||(m.pageData.Filter.RowCount=s),Q(s)}),p()()()}if(o&2){let a=x(2);f(4),M("accessType",2),Le("ngModel",a.pageData.Filter.EntityID),M("multiple",!1),f(4),Le("ngModel",a.pageData.Filter.VariantID),M("inputTextValue",a.variantName)("displayText",a.variantName)("renderThumbnail",!0),f(4),Le("date",a.pageData.Filter.From),f(4),Le("date",a.pageData.Filter.To),f(4),Le("ngModel",a.pageData.Filter.Note),f(4),M("max",1e4),Le("ngModel",a.pageData.Filter.RowCount)}}function l5(o,c){o&1&&(d(0,"th"),v(1,"Modified"),p())}function s5(o,c){o&1&&(d(0,"th"),v(1,"Modify By"),p())}function c5(o,c){o&1&&(d(0,"th"),v(1,"Note"),p())}function d5(o,c){o&1&&(d(0,"th"),v(1,"Code"),p())}function p5(o,c){o&1&&(d(0,"th",22),v(1,"Landed Cost"),p())}function m5(o,c){o&1&&(d(0,"th",23),v(1,"Buying Cost"),p())}function f5(o,c){o&1&&(d(0,"th",24),v(1,"Selling Price"),p())}function u5(o,c){o&1&&(d(0,"th"),v(1,"Outlet"),p())}function v5(o,c){o&1&&(d(0,"th"),v(1,"Reference"),p())}function g5(o,c){if(o&1&&(d(0,"td"),v(1),F(2,"date"),p()),o&2){let a=x().$implicit;f(),Ae(Ie(2,1,a.Created,"dd MMM yyyy HH:mm"))}}function b5(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.UserName)}}function h5(o,c){if(o&1&&(G(0,"td",27),F(1,"newlines")),o&2){let a=x().$implicit;M("innerHTML",Ce(1,1,a.Note),W1)}}function x5(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.Code)}}function _5(o,c){if(o&1&&(d(0,"td",22),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),Ae(Ce(2,1,a.LandedCost))}}function C5(o,c){if(o&1&&(d(0,"td",22),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ie(2,1,a.UnitCost,"1.0-4")," ")}}function y5(o,c){if(o&1&&(d(0,"td",22),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ie(2,1,a.UnitPrice,"1.0-4")," ")}}function w5(o,c){if(o&1&&(d(0,"td"),v(1),p()),o&2){let a=x().$implicit;f(),Ae(a.EntityName)}}function A5(o,c){if(o&1&&(d(0,"a",28),v(1),p()),o&2){let a=x(2).$implicit,l=x(3);M("routerLink",ot(3,i5,l.linkReference(a.TypeID)))("queryParams",ot(5,cf,a.ReferenceID)),f(),oe(" ",a.DisplayReference," ")}}function S5(o,c){if(o&1&&v(0),o&2){let a=x(2).$implicit;oe(" ",a.DisplayReference," ")}}function I5(o,c){if(o&1&&(d(0,"td"),k(1,A5,2,7,"a",28)(2,S5,1,1),p()),o&2){let a=x().$implicit,l=x(3);f(),D(a.ReferenceID&&l.isValidTypeID(a.TypeID)?1:2)}}function k5(o,c){if(o&1&&(d(0,"tr",25)(1,"td")(2,"a",26),v(3),p()(),k(4,g5,3,4,"td"),k(5,b5,2,1,"td"),k(6,h5,2,3,"td",27),k(7,x5,2,1,"td"),k(8,_5,3,3,"td",22),k(9,C5,3,4,"td",22),k(10,y5,3,4,"td",22),k(11,w5,2,1,"td"),k(12,I5,3,1,"td"),p()),o&2){let a=c.$implicit,l=x(3);f(2),M("routerLink",ft(12,Pg))("queryParams",ot(13,cf,a.ParentID)),f(),Ae(a.VariantName),f(),D(l.column.Modified.selected?4:-1),f(),D(l.column.ModifyBy.selected?5:-1),f(),D(l.column.Note.selected?6:-1),f(),D(l.column.Code.selected?7:-1),f(),D(l.column.LandedCost.selected?8:-1),f(),D(l.roleService.product.Cost&&l.column.BuyingCost.selected?9:-1),f(),D(l.roleService.sell.UnitPriceEditor&&l.column.SellingPrice.selected?10:-1),f(),D(l.column.Outlet.selected?11:-1),f(),D(l.column.Reference.selected?12:-1)}}function D5(o,c){if(o&1&&(d(0,"table",8)(1,"thead",21)(2,"tr")(3,"th"),v(4,"Variant"),p(),k(5,l5,2,0,"th"),k(6,s5,2,0,"th"),k(7,c5,2,0,"th"),k(8,d5,2,0,"th"),k(9,p5,2,0,"th",22),k(10,m5,2,0,"th",23),k(11,f5,2,0,"th",24),k(12,u5,2,0,"th"),k(13,v5,2,0,"th"),p()(),d(14,"tbody"),Jt(15,k5,13,15,"tr",25,vi),p()()),o&2){let a=x(2);f(5),D(a.column.Modified.selected?5:-1),f(),D(a.column.ModifyBy.selected?6:-1),f(),D(a.column.Note.selected?7:-1),f(),D(a.column.Code.selected?8:-1),f(),D(a.column.LandedCost.selected?9:-1),f(),D(a.roleService.product.Cost&&a.column.BuyingCost.selected?10:-1),f(),D(a.roleService.sell.UnitPriceEditor&&a.column.SellingPrice.selected?11:-1),f(),D(a.column.Outlet.selected?12:-1),f(),D(a.column.Reference.selected?13:-1),f(2),Kt(a.data.Data)}}function M5(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",2),je("textChange",function(s){U(a);let m=x();return Oe(m.pageData.Filter.UserName,s)||(m.pageData.Filter.UserName=s),Q(s)}),de("onSubmit",function(){U(a);let s=x();return Q(s.searchFromPageOne())}),je("filterChange",function(s){U(a);let m=x();return Oe(m.pageData.Filter,s)||(m.pageData.Filter=s),Q(s)}),de("onChangeColumnCheckbox",function(){U(a);let s=x();return Q(s.checkForAdvancedColumn())}),d(1,"actions"),k(2,n5,3,0,"button",3),k(3,a5,2,5,"a",4)(4,r5,2,2,"a",5),p(),d(5,"filters"),_i(6,o5,25,12,"ng-template",null,0,co),p(),d(8,"content")(9,"div",6)(10,"div",7),k(11,D5,17,9,"table",8),p(),d(12,"div",9)(13,"POS-complex-pagination",10),de("jumpToPage",function(){U(a);let s=x();return Q(s.getListData())})("previousPage",function(){U(a);let s=x();return Q(s.getListData())})("nextPage",function(){U(a);let s=x();return Q(s.getListData())}),p()()()()()}if(o&2){let a=x();M("pageData",a.menuData)("hideSearchBox",!0),Le("text",a.pageData.Filter.UserName),M("isFilterOnDropdown",!1),Le("filter",a.pageData.Filter),M("column",a.column),f(2),D(a.roleService.global.Export?2:-1),f(),D(a.pageData.Filter.VariantID?3:4),f(8),D(a.pageData?11:-1),f(2),M("total",a.data.Data.length)("pageData",a.pageData)}}var Hd=class o extends gc{constructor(a,l,s,m,h,_,w){super(s,m,"catalog/variant/VariantHistoryList","catalog/VariantLoader/VariantHistoryLoader",h,l);this.csvConverter=a;this.activatedRoute=l;this.httpService=m;this.roleService=_;this.matDialog=w;this.urlParams=this.activatedRoute.snapshot.queryParams}csvConverter;activatedRoute;httpService;roleService;matDialog;variantName;urlParams;typeId=Ld;columnService=dn(ld);column={Modified:{selected:!0,name:"Modified"},ModifyBy:{selected:!0,name:"Modify By"},Note:{selected:!0,name:"Note"},Code:{selected:!1,name:"Code"},LandedCost:{selected:!1,name:"Landed Cost"},BuyingCost:{selected:!0,name:"Buying Cost"},SellingPrice:{selected:!0,name:"Selling Price"},Outlet:{selected:!1,name:"Outlet"},Reference:{selected:!0,name:"Reference"}};onExportToCsv(){this.convertToCSV(this.csvConverter,this.data.Data,"Variant_Update_History")}postInit(a){this.menuData.H=a.PageTitle,Object.entries(this.urlParams).length>0&&(this.variantName=this.pageData.VariantName);let l=this.data.Data.map(s=>{let m=s.Note.replace(/"/g,'""');return s=Fo(kr({},s),{Note:m}),s});this.data.Data=l}preInitList(){Object.entries(this.urlParams).length>0&&(this.pageData.Filter=Object.assign(this.pageData.Filter,this.urlParams))}isValidTypeID(a){return Object.values(Ld).includes(a)}linkReference(a){let l="";switch(a){case 2:l="/menu/Orders/Order/Purchase_Order/Info";break;case 3:l="/menu/Manufacture/Job_Order/Archive/Info";break;case 6:l="/menu/Orders/Order/Purchase_Order/Info";break;default:break}return l}openExportModal(){this.matDialog.open(Kr,{data:{title:"Variant History",exportTypes:[{ID:"ProductExport/VariantUpdateHistoryExport",Value:"Default",FileName:"Variant History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data?.Data,this.pageData?.Filter)}static \u0275fac=function(l){return new(l||o)(se(Z1),se(Jn),se(en),se(ki),se(zi),se(yi),se(Ma))};static \u0275cmp=nt({type:o,selectors:[["POS-history-variant"]],standalone:!1,features:[$i],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","hideSearchBox","text","isFilterOnDropdown","filter","column"],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","Return to Variant",1,"btn","btn-success",3,"routerLink","queryParams"],["role","button","matTooltipPosition","above","matTooltip","Return to Variant",1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"d-sm-block","mt-2"],["api","catalog/variant/VariantHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose an outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue","displayText","renderThumbnail"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"text-end",2,"width","78px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"]],template:function(l,s){l&1&&k(0,M5,14,11,"mainpanel-cmp",1),l&2&&D(s.data?0:-1)},dependencies:[Ei,tn,li,Cn,Vi,Ri,Xr,_o,Il,us,Zo,Li,Vn,Ov],encapsulation:2})};var E5=()=>["/menu/Products/Catalog/Variants/Info"],T5=o=>({ID:o});function P5(o,c){if(o&1){let a=Se();d(0,"button",19),de("click",function(){U(a);let s=x(3);return Q(s.onErase(s.pageData().Filter.EntityID,s.pageData().Filter.CategoryID))}),G(1,"i",20),v(2," Erase "),p()}}function B5(o,c){if(o&1){let a=Se();d(0,"div",3)(1,"button",16),de("click",function(){U(a);let s=x(2);return Q(s.deleteRowCustomOutlet())}),G(2,"i",17),v(3,"Delete "),p(),k(4,P5,3,0,"button",18),p()}if(o&2){let a=x(2);f(4),D(a.roleService.product.DeleteAllOutletPrice?4:-1)}}function N5(o,c){if(o&1){let a=Se();d(0,"button",22),de("click",function(){U(a);let s=x(3);return Q(s.deleteRowCustomOutlet())}),G(1,"i",17),v(2,"Delete "),p()}}function F5(o,c){if(o&1&&k(0,N5,3,0,"button",21),o&2){let a=x(2);D(a.getSelectedData().length>0?0:-1)}}function V5(o,c){if(o&1){let a=Se();d(0,"button",23),de("click",function(){U(a);let s=x(2);return Q(s.openExportModal())}),G(1,"i",24),v(2," Export "),p()}}function R5(o,c){if(o&1){let a=Se();d(0,"div",25)(1,"h6"),v(2,"Outlet"),p(),d(3,"ng-select",26),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.EntityID,s)||(m.pageData().Filter.EntityID=s),Q(s)}),p(),d(4,"h6"),v(5,"Category"),p(),d(6,"POS-product-category-select",27),je("selectedCategoryIDChange",function(s){U(a);let m=x(2);return Oe(m.pageData().Filter.CategoryID,s)||(m.pageData().Filter.CategoryID=s),Q(s)}),p()()}if(o&2){let a=x(2);f(3),M("items",a.pageData().Options.Entities),Le("ngModel",a.pageData().Filter.EntityID),f(3),Le("selectedCategoryID",a.pageData().Filter.CategoryID),M("showClear",!0)}}function O5(o,c){if(o&1){let a=Se();d(0,"th",10)(1,"input",28),de("change",function(s){U(a);let m=x(2);return Q(m.onSelectAllData(s.target.checked))}),p()()}if(o&2){let a,l=x(2);f(),M("checked",l.getSelectedData().length==((a=l.data().Data)==null?null:a.length)&&((a=l.data().Data)==null?null:a.length)>0)}}function U5(o,c){o&1&&(d(0,"th",11),v(1,"Unit Cost"),p())}function Q5(o,c){o&1&&(d(0,"th",11),v(1,"Extra Cost"),p())}function j5(o,c){if(o&1){let a=Se();d(0,"td")(1,"input",30),je("ngModelChange",function(s){U(a);let m=x().$implicit;return Oe(m.selected,s)||(m.selected=s),Q(s)}),p()()}if(o&2){let a=x().$implicit;f(),Le("ngModel",a.selected)}}function L5(o,c){if(o&1&&(d(0,"td",11),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitCost)," ")}}function H5(o,c){if(o&1&&(d(0,"td",11),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.ExtraCost)," ")}}function q5(o,c){if(o&1&&(d(0,"tr",12),k(1,j5,2,1,"td"),d(2,"td"),v(3),p(),d(4,"td"),v(5),p(),d(6,"td")(7,"a",29),v(8),p()(),d(9,"td"),v(10),p(),k(11,L5,3,3,"td",11),d(12,"td",11),v(13),F(14,"number"),p(),k(15,H5,3,3,"td",11),d(16,"td",11),v(17),F(18,"number"),p(),d(19,"td",11),v(20),F(21,"number"),p()()),o&2){let a=c.$implicit,l=x(2);f(),D(l.roleService.product.Delete?1:-1),f(2),Ae(a.Name),f(2),Ae(a.CategoryName),f(2),M("routerLink",ft(18,E5))("queryParams",ot(19,T5,a.VariantID)),f(),Ae(a.VariantName),f(2),Ae(a.VariantCode),f(),D(l.roleService.product.Cost?11:-1),f(2),Ae(Ce(14,12,a.UnitPrice)),f(2),D(l.roleService.product.Cost?15:-1),f(2),Ae(Ce(18,14,a.OutletPrice)),f(3),Ae(Ce(21,16,a.PriceDiscount))}}function G5(o,c){if(o&1){let a=Se();d(0,"POS-complex-pagination",31),de("jumpToPage",function(){U(a);let s=x(2);return Q(s.getListData())})("previousPage",function(){U(a);let s=x(2);return Q(s.getListData())})("nextPage",function(){U(a);let s=x(2);return Q(s.getListData())}),p()}if(o&2){let a=x(2);M("total",a.data().Data.length)("pageData",a.pageData())}}function z5(o,c){if(o&1){let a=Se();d(0,"mat-paginator",32),de("page",function(s){U(a);let m=x(2);return Q(m.onPaginationChange(s))}),p()}if(o&2){let a=x(2);M("length",a.pagination.listTotal())("pageSize",a.pagination.pageSize())("pageIndex",a.pageData().Filter.PageNumber==0?0:a.pageData().Filter.PageNumber-1)}}function Y5(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",2),de("onSubmit",function(){U(a);let s=x();return Q(s.searchFromPageOne())}),je("filterChange",function(s){U(a);let m=x();return Oe(m.pageData().Filter,s)||(m.pageData().Filter=s),Q(s)}),d(1,"actions"),k(2,B5,5,1,"div",3)(3,F5,1,1),k(4,V5,3,0,"button",4),p(),d(5,"filters"),_i(6,R5,7,4,"ng-template",null,0,co),p(),d(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr",9),k(14,O5,2,1,"th",10),d(15,"th"),v(16,"Name"),p(),d(17,"th"),v(18,"Category"),p(),d(19,"th"),v(20,"Variant"),p(),d(21,"th"),v(22,"Code"),p(),k(23,U5,2,0,"th",11),d(24,"th",11),v(25,"Unit Price"),p(),k(26,Q5,2,0,"th",11),d(27,"th",11),v(28,"Outlet Price"),p(),d(29,"th",11),v(30,"%"),p()()(),d(31,"tbody"),Jt(32,q5,22,21,"tr",12,vi),p()(),k(34,G5,1,2,"POS-complex-pagination",13),p(),d(35,"div",14),k(36,z5,1,3,"mat-paginator",15),p()()()()}if(o&2){let a,l=x();M("pageData",l.menuData())("hideSearchBox",!0)("isFilterOnDropdown",!1),Le("filter",l.pageData().Filter),f(2),D(l.getSelectedData().length==((a=l.data().Data)==null?null:a.length)&&((a=l.data().Data)==null?null:a.length)>0?2:3),f(2),D(l.roleService.global.Export?4:-1),f(10),D(l.roleService.product.Delete?14:-1),f(9),D(l.roleService.product.Cost?23:-1),f(3),D(l.roleService.product.Cost?26:-1),f(6),Kt(l.data().Data),f(2),D(l.data().Data.length>0?34:-1),f(2),D(l.pagination.listTotal()>0?36:-1)}}var qd=class o extends Sl{constructor(a,l,s,m,h,_,w){super(l,s,"catalog/product/OutletPrice","catalog/ProductLoader/OutletPrice",m);this.csvConverter=a;this.httpService=s;this.toasterClient=h;this.roleService=_;this.matDialog=w}csvConverter;httpService;toasterClient;roleService;matDialog;deleteRowCustomOutlet(){let l=this.getSelectedData().map(s=>({key1:s.VariantID,key2:s.EntityID}));this.httpService.post("/api/catalog/product/DeleteOutletPrice",{Data:l}).subscribe(()=>{this.toasterClient.success("Success Custom Outlet Price",Zi.Success),this.getListData()})}onErase(a,l){this.getOutletPriceCount$().pipe(Gl(s=>this.matDialog.open(pg,{data:{title:"Erase Outlet Price(s)",message:`
|
|
2
2
|
<h4 class="text-center" >
|
|
3
3
|
${s} Outlet Price(s) will be erased permanently.
|
|
4
4
|
</h4>
|
|
@@ -16,4 +16,4 @@ import{a as Dd}from"./chunk-A6SE3QXT.js";import{a as wg}from"./chunk-W6CIVNQM.js
|
|
|
16
16
|
`:"")+J+A+`</svg>
|
|
17
17
|
`}};function ne(J,X){J+=K,X+=ae;var te=o*J+c*X+a*(ee-1)+l*(ie-1),ue=s*J+m*X+h*(ee-1)+_*(ie-1);return""+((te|0)==te?te:te.toFixed(2))+" "+((ue|0)==ue?ue:ue.toFixed(2))}}var D1=(function(){var o=[],c={},a={},l={},s=0;return l.next=l,l.prev=l,{lookup:h,monochrome:_,getglyph:w,getpaths:A,loadFont:m};function m(I){var P=100,T=100,B=null;if(arguments.length==2)B=arguments[1];else if(arguments.length==3)P=T=+arguments[1]||100,B=arguments[2];else if(arguments.length==4)T=+arguments[1]||100,P=+arguments[2]||100,B=arguments[3];else throw new Error("bwipjs: loadFont: invalid number of arguments");I=I.toUpperCase();var L=xp.InitFont(fA(B));L.bwipjs_name=I,L.bwipjs_multx=P,L.bwipjs_multy=T;var N=c[I];return N==null?c[I]=N=o.push(L)-1:o[N]=L,N}function h(I){var P=c[I.toUpperCase()];return P===void 0?1:P}function _(I){if(I)throw new Error("bwipjs: monochrome fonts not implemented")}function w(I,P,T,B){I=I|0,P=P|0,T=+T,B=+B,(!T||T<8)&&(T=8),(!B||B<8)&&(B=T),(I<0||I>=o.length)&&(I=1),(!P||P<32)&&(P=32);var L=""+I+"c"+P+"w"+T+"h"+B,Y=a[L];if(Y){Y.prev.next=Y.next,Y.next.prev=Y.prev;var ie=l;return ie.next.prev=Y,Y.next=ie.next,Y.prev=ie,ie.next=Y,Y}var N=o[I],Y=xp.GetGlyph(N,P,T*N.bwipjs_multx/100,B*N.bwipjs_multy/100)||xp.GetGlyph(N,0,T*N.bwipjs_multx/100,B*N.bwipjs_multy/100);if(Y.bytes=Y.pixels,Y.cachekey=L,Y.offset=0,s>250){var ie=l,ee=ie.prev;ee.prev.next=ie,ie.prev=ee.prev,ee.next=ee.prev=null,delete a[ee.cachekey]}else s++;a[L]=Y;var ie=l;return ie.next.prev=Y,Y.next=ie.next,Y.prev=ie,ie.next=Y,Y}function A(I,P,T,B){I=I|0,P=P|0,T=+T,B=+B,(!T||T<8)&&(T=8),(!B||B<8)&&(B=T),(I<0||I>=o.length)&&(I=1),(!P||P<32)&&(P=32);var L=o[I];return xp.GetPaths(L,P,T*L.bwipjs_multx/100,B*L.bwipjs_multy/100)}})();function mA(){return D1.loadFont.apply(D1,Array.prototype.slice.call(arguments))}var xp=(function(){var o=1,c=2,a=3,l=4,s=0,m=1,h=2,_=3,w=0,A=1,I=2,P=3,T=4,B=0,L=1,N=2,Y=10,ee=Math.floor,ie=Math.ceil,K=Math.sqrt,ae=Math.abs;function ne(S){for(var R=[],V=0;V<S;V++)R.push({});return R}function J(S){return S[S.cursor++]||0}function X(S){return S[S.cursor]}function te(S,R){S.cursor=R>S.length||R<0?S.length:R}function ue(S,R){te(S,S.cursor+R)}function ve(S,R){for(var V=0,H=0;H<R;H++)V=V<<8|J(S);return V}function ye(){return{length:0}}function Z(S,R,V){if(R<0||V<0||R>S.length||V>S.length-R)return ye();var H=S.subarray(R,R+V);return H.cursor=0,H}function le(S){var R=S.cursor,V=ve(S,2);if(V){var H=J(S);ue(S,H*V),ue(S,ve(S,H)-1)}return Z(S,R,S.cursor-R)}function ce(S){var R=J(S);return R>=32&&R<=246?R-139:R>=247&&R<=250?(R-247)*256+J(S)+108:R>=251&&R<=254?-(R-251)*256-J(S)-108:R==28?ve(S,2):R==29?ve(S,4):0}function fe(S){var R=X(S);if(R==30)for(ue(S,1);S.cursor<S.length;){var V=J(S);if((V&15)==15||V>>4==15)break}else ce(S)}function ge(S,R){for(te(S,0);S.cursor<S.length;){for(var V=S.cursor,H,$;X(S)>=28;)fe(S);if(H=S.cursor,$=J(S),$==12&&($=J(S)|256),$==R)return Z(S,V,H-V)}return Z(S,0,0)}function _e(S,R,V,H){for(var $=ge(S,R),pe=0;pe<V&&$.cursor<$.length;pe++)H[pe]=ce($)}function ke(S,R,V){var H=ge(S,R);return H.cursor<H.length&&(V=ce(H)),V}function Ee(S){return te(S,0),ve(S,2)}function De(S,R){var V,H,$,pe;return te(S,0),V=ve(S,2),H=J(S),ue(S,R*H),$=ve(S,H),pe=ve(S,H),Z(S,2+(V+1)*H+$,pe-$)}function Te(S){return S&32768?(4294901760|S)>>0:S}function Fe(S,R){return S[R]*256+S[R+1]}function xe(S,R){var V=S[R]*256+S[R+1];return V&32768?(4294901760|V)>>0:V}function Je(S,R){return(S[R]<<24)+(S[R+1]<<16)+(S[R+2]<<8)+S[R+3]}function Ke(S,R,V){for(var H=Fe(S,R+4),$=R+12,pe=0;pe<H;++pe){var q=$+16*pe;if(S[q]==V[0]&&S[q+1]==V[1]&&S[q+2]==V[2]&&S[q+3]==V[3])return Je(S,q+8)}return 0}function Ge(S,R){var V=[0,0];if(_e(R,18,2,V),!V[1]||!V[0])return ye();var H=Z(S,V[1],V[0]),$=ke(H,19,0);return $?(te(S,V[1]+$),le(S)):ye()}function vt(S,R,V){var H,$,pe,q;if(S.data=R,S.fontstart=V,S.cff=ye(),H=Ke(R,V,[99,109,97,112]),S.loca=Ke(R,V,[108,111,99,97]),S.head=Ke(R,V,[104,101,97,100]),S.glyf=Ke(R,V,[103,108,121,102]),S.hhea=Ke(R,V,[104,104,101,97]),S.hmtx=Ke(R,V,[104,109,116,120]),S.kern=Ke(R,V,[107,101,114,110]),!H||!S.head||!S.hhea||!S.hmtx)return 0;if(S.glyf){if(!S.loca)return 0}else{var be,O,he,Pe,Ne=2,re=0,He=0,Ue=0;if(Pe=Ke(R,V,[67,70,70,32]),!Pe||(S.fontdicts=ye(),S.fdselect=ye(),S.cff=R.subarray(Pe),S.cff.cursor=0,be=S.cff,ue(be,2),te(be,J(be)),le(be),he=le(be),O=De(he,0),le(be),S.gsubrs=le(be),re=ke(O,17,re),Ne=ke(O,262,Ne),He=ke(O,292,He),Ue=ke(O,293,Ue),S.subrs=Ge(be,O),Ne!=2)||re==0)return 0;if(He){if(!Ue)return 0;te(be,He),S.fontdicts=le(be),S.fdselect=Z(be,Ue,be.length-Ue)}te(be,re),S.charstrings=le(be)}for($=Ke(R,V,[109,97,120,112]),$?S.numGlyphs=Fe(R,$+4):S.numGlyphs=65535,q=Fe(R,H+2),S.index_map=0,pe=0;pe<q;++pe){var Me=H+4+8*pe;switch(Fe(R,Me)){case _:switch(Fe(R,Me+2)){case L:case Y:S.index_map=H+Je(R,Me+4);break}break;case s:S.index_map=H+Je(R,Me+4);break}}return S.index_map==0?0:(S.indexToLocFormat=Fe(R,S.head+50),1)}function Ze(S,R){var V=S.data,H=S.index_map,$=Fe(V,H+0);if($==0){var pe=Fe(V,H+2);return R<pe-6?V[H+6+R]:0}else if($==6){var q=Fe(V,H+6),be=Fe(V,H+8);return R>=q&&R<q+be?Fe(V,H+10+(R-q)*2):0}else{if($==2)return 0;if($==4){var O=Fe(V,H+6)>>1,he=Fe(V,H+8)>>1,Pe=Fe(V,H+10),Ne=Fe(V,H+12)>>1,re=H+14,He=re;if(R>65535)return 0;for(R>=Fe(V,He+Ne*2)&&(He+=Ne*2),He-=2;Pe;){he>>=1;var Ue=Fe(V,He+he*2);R>Ue&&(He+=he*2),--Pe}He+=2;var Me,Xe,we=He-re>>>1;return Xe=Fe(V,H+14+O*2+2+2*we),R<Xe?0:(Me=Fe(V,H+14+O*6+2+2*we),Me==0?R+xe(V,H+14+O*4+2+2*we):Fe(V,Me+(R-Xe)*2+H+14+O*6+2+2*we))}else if($==12||$==13){for(var We=Je(V,H+12),Bt=0,ct=We;Bt<ct;){var tt=Bt+(ct-Bt>>1),lt=Je(V,H+16+tt*12),kt=Je(V,H+16+tt*12+4);if(R<lt)ct=tt;else if(R>kt)Bt=tt+1;else{var at=Je(V,H+16+tt*12+8);return $==12?at+R-lt:at}}return 0}}return 0}function Ct(S,R,V,H,$,pe){S.type=R,S.x=V,S.y=H,S.cx=$,S.cy=pe}function ze(S,R){var V,H;return R>=S.numGlyphs||S.indexToLocFormat>=2?-1:(S.indexToLocFormat==0?(V=S.glyf+Fe(S.data,S.loca+R*2)*2,H=S.glyf+Fe(S.data,S.loca+R*2+2)*2):(V=S.glyf+Je(S.data,S.loca+R*4),H=S.glyf+Je(S.data,S.loca+R*4+4)),V==H?-1:V)}function st(S,R,V){if(S.cff.length)Ot(S,R,V);else{var H=ze(S,R);if(H<0)return 0;V.x0=xe(S.data,H+2),V.y0=xe(S.data,H+4),V.x1=xe(S.data,H+6),V.y1=xe(S.data,H+8)}return 1}function xt(S,R,V,H,$,pe,q,be,O,he){return H?(V&&Ct(S[R++],a,O+q>>1,he+be>>1,O,he),Ct(S[R++],a,$,pe,q,be)):V?Ct(S[R++],a,$,pe,O,he):Ct(S[R++],c,$,pe,0,0),R}function ut(S,R){var V=S.data,H=ze(S,R);if(H<0)return null;var $=[],pe=xe(V,H);if(pe>0){var q=0,be,O,he=0,Pe,Ne,re,He=0,Ue,Me=0,Xe,we,We,Bt,ct,tt,lt,kt,at=H+10,rt=Fe(V,H+10+pe*2),pt=V.subarray(H+10+pe*2+2+rt),mt=0;for(Ne=1+Fe(V,at+pe*2-2),Pe=Ne+2*pe,$=ne(Pe),re=0,be=0,Ue=Pe-Ne,O=0;O<Ne;++O)be==0?(q=pt[mt++],q&8&&(be=pt[mt++])):--be,$[Ue+O].type=q;for(Xe=0,O=0;O<Ne;++O){if(q=$[Ue+O].type,q&2){var It=pt[mt++];Xe+=q&16?It:-It}else q&16||(Xe=Xe+Te(pt[mt]*256+pt[mt+1]),mt+=2);$[Ue+O].x=Xe}for(we=0,O=0;O<Ne;++O){if(q=$[Ue+O].type,q&4){var ri=pt[mt++];we+=q&32?ri:-ri}else q&32||(we=we+Te(pt[mt]*256+pt[mt+1]),mt+=2);$[Ue+O].y=we}var jt=0;for(ct=tt=We=Bt=lt=kt=0,O=0;O<Ne;++O)q=$[Ue+O].type,Xe=$[Ue+O].x,we=$[Ue+O].y,re==O?(O!=0&&(jt=xt($,jt,He,Me,ct,tt,lt,kt,We,Bt)),Me=!(q&1),Me?(lt=Xe,kt=we,$[Ue+O+1].type&1?(ct=$[Ue+O+1].x,tt=$[Ue+O+1].y,++O):(ct=Xe+$[Ue+O+1].x>>1,tt=we+$[Ue+O+1].y>>1)):(ct=Xe,tt=we),Ct($[jt++],o,ct,tt,0,0),He=0,re=1+Fe(V,at+he*2),++he):q&1?(He?Ct($[jt++],a,Xe,we,We,Bt):Ct($[jt++],c,Xe,we,0,0),He=0):(He&&Ct($[jt++],a,We+Xe>>1,Bt+we>>1,We,Bt),We=Xe,Bt=we,He=1);$.length=xt($,jt,He,Me,ct,tt,lt,kt,We,Bt)}else if(pe==-1)for(var ui=1,Ut=H+10;ui;){var q,wi,$e=[1,0,0,1,0,0];q=xe(V,Ut),Ut+=2,wi=xe(V,Ut),Ut+=2,q&2&&(q&1?($e[4]=xe(V,Ut),Ut+=2,$e[5]=xe(V,Ut),Ut+=2):($e[4]=J(V,Ut),Ut+=1,$e[5]=J(V,Ut),Ut+=1)),q&8?($e[0]=$e[3]=xe(V,Ut)/16384,Ut+=2,$e[1]=$e[2]=0):q&64?($e[0]=xe(V,Ut)/16384,Ut+=2,$e[1]=$e[2]=0,$e[3]=xe(V,Ut)/16384,Ut+=2):q&128&&($e[0]=xe(V,Ut)/16384,Ut+=2,$e[1]=xe(V,Ut)/16384,Ut+=2,$e[2]=xe(V,Ut)/16384,Ut+=2,$e[3]=xe(V,Ut)/16384,Ut+=2);var Pe=K($e[0]*$e[0]+$e[1]*$e[1]),Ne=K($e[2]*$e[2]+$e[3]*$e[3]),Di=Ht(S,wi);if(Di.length>0){for(var O=0,Ti=Di.length;O<Ti;++O){var hi=Di[O],Xe,we;Xe=hi.x,we=hi.y,hi.x=ee(Pe*($e[0]*Xe+$e[2]*we+$e[4])),hi.y=ee(Ne*($e[1]*Xe+$e[3]*we+$e[5])),Xe=hi.cx,we=hi.cy,hi.cx=ee(Pe*($e[0]*Xe+$e[2]*we+$e[4])),hi.cy=ee(Ne*($e[1]*Xe+$e[3]*we+$e[5]))}$=$.concat(Di)}ui=q&32}return $}function gt(S,R,V){(R>S.max_x||!S.started)&&(S.max_x=R),(V>S.max_y||!S.started)&&(S.max_y=V),(R<S.min_x||!S.started)&&(S.min_x=R),(V<S.min_y||!S.started)&&(S.min_y=V),S.started=1}function it(S,R,V,H,$,pe,q,be){gt(S,V,H),R==l&&(gt(S,$,pe),gt(S,q,be));var O={};Ct(O,R,V,H,$,pe),O.cx1=q,O.cy1=be,S.vertices.push(O)}function Nt(S){(S.first_x!=S.x||S.first_y!=S.y)&&it(S,c,S.first_x,S.first_y,0,0,0,0)}function Pt(S,R,V){Nt(S),S.first_x=S.x=S.x+R,S.first_y=S.y=S.y+V,it(S,o,S.x,S.y,0,0,0,0)}function et(S,R,V){S.x+=R,S.y+=V,it(S,c,S.x,S.y,0,0,0,0)}function _t(S,R,V,H,$,pe,q){var be=S.x+R,O=S.y+V,he=be+H,Pe=O+$;S.x=he+pe,S.y=Pe+q,it(S,l,S.x,S.y,be,O,he,Pe)}function Rt(S,R){var V=Ee(S),H=107;return V>=33900?H=32768:V>=1240&&(H=1131),R+=H,R<0||R>=V?ye():De(S,R)}function Xt(S,R){var V=S.fdselect,H,$,pe,q,be,O=-1,he;if(te(V,0),be=J(V),be==0)ue(V,R),O=J(V);else if(be==3)for(H=ve(V,2),$=ve(V,2),he=0;he<H;he++){if(q=J(V),pe=ve(V,2),R>=$&&R<pe){O=q;break}$=pe}return O==-1&&ye(),Ge(S.cff,De(S.fontdicts,O))}function Mt(S,R,V){var H=1,$=0,pe=0,q=0,be,O,he,Pe=0,Ne,re=[],He=[],Ue=S.subrs,Me,Xe;for(Me=De(S.charstrings,R);Me.cursor<Me.length;){switch(O=0,Ne=1,he=J(Me),he){case 19:case 20:H&&($+=q/2|0),H=0,ue(Me,($+7)/8|0);break;case 1:case 3:case 18:case 23:$+=q/2|0;break;case 21:if(H=0,q<2)return 0;Pt(V,re[q-2],re[q-1]);break;case 4:if(H=0,q<1)return 0;Pt(V,0,re[q-1]);break;case 22:if(H=0,q<1)return 0;Pt(V,re[q-1],0);break;case 5:if(q<2)return 0;for(;O+1<q;O+=2)et(V,re[O],re[O+1]);break;case 7:if(q<1)return 0;for(;!(O>=q||(et(V,0,re[O]),O++,O>=q));)et(V,re[O],0),O++;break;case 6:if(q<1)return 0;for(;!(O>=q||(et(V,re[O],0),O++,O>=q));)et(V,0,re[O]),O++;break;case 31:if(q<4)return 0;for(;!(O+3>=q||(_t(V,re[O],0,re[O+1],re[O+2],q-O==5?re[O+4]:0,re[O+3]),O+=4,O+3>=q));)_t(V,0,re[O],re[O+1],re[O+2],re[O+3],q-O==5?re[O+4]:0),O+=4;break;case 30:if(q<4)return 0;for(;!(O+3>=q||(_t(V,0,re[O],re[O+1],re[O+2],re[O+3],q-O==5?re[O+4]:0),O+=4,O+3>=q));)_t(V,re[O],0,re[O+1],re[O+2],q-O==5?re[O+4]:0,re[O+3]),O+=4;break;case 8:if(q<6)return 0;for(;O+5<q;O+=6)_t(V,re[O],re[O+1],re[O+2],re[O+3],re[O+4],re[O+5]);break;case 24:if(q<8)return 0;for(;O+5<q-2;O+=6)_t(V,re[O],re[O+1],re[O+2],re[O+3],re[O+4],re[O+5]);if(O+1>=q)return 0;et(V,re[O],re[O+1]);break;case 25:if(q<8)return 0;for(;O+1<q-6;O+=2)et(V,re[O],re[O+1]);if(O+5>=q)return 0;_t(V,re[O],re[O+1],re[O+2],re[O+3],re[O+4],re[O+5]);break;case 26:case 27:if(q<4)return 0;for(Xe=0,q&1&&(Xe=re[O],O++);O+3<q;O+=4)he==27?_t(V,re[O],Xe,re[O+1],re[O+2],re[O+3],0):_t(V,Xe,re[O],re[O+1],re[O+2],0,re[O+3]),Xe=0;break;case 10:Pe||(S.fdselect.length&&(Ue=Xt(S,R)),Pe=1);case 29:if(q<1||(be=re[--q]|0,pe>=10)||(He[pe++]=Me,Me=Rt(he==10?Ue:S.gsubrs,be),Me.length==0))return 0;Me.cursor=0,Ne=0;break;case 11:if(pe<=0)return 0;Me=He[--pe],Ne=0;break;case 14:return Nt(V),1;case 12:var we,We,Bt,ct,tt,lt,kt,at,rt,pt,mt,It,ri,jt,ui=J(Me);switch(ui){case 34:if(q<7)return 0;we=re[0],We=re[1],at=re[2],Bt=re[3],ct=re[4],tt=re[5],lt=re[6],_t(V,we,0,We,at,Bt,0),_t(V,ct,0,tt,-at,lt,0);break;case 35:if(q<13)return 0;we=re[0],kt=re[1],We=re[2],at=re[3],Bt=re[4],rt=re[5],ct=re[6],pt=re[7],tt=re[8],mt=re[9],lt=re[10],It=re[11],_t(V,we,kt,We,at,Bt,rt),_t(V,ct,pt,tt,mt,lt,It);break;case 36:if(q<9)return 0;we=re[0],kt=re[1],We=re[2],at=re[3],Bt=re[4],ct=re[5],tt=re[6],mt=re[7],lt=re[8],_t(V,we,kt,We,at,Bt,0),_t(V,ct,0,tt,mt,lt,-(kt+at+mt));break;case 37:if(q<11)return 0;we=re[0],kt=re[1],We=re[2],at=re[3],Bt=re[4],rt=re[5],ct=re[6],pt=re[7],tt=re[8],mt=re[9],lt=It=re[10],ri=we+We+Bt+ct+tt,jt=kt+at+rt+pt+mt,ae(ri)>ae(jt)?It=-jt:lt=-ri,_t(V,we,kt,We,at,Bt,rt),_t(V,ct,pt,tt,mt,lt,It);break;default:return 0}break;default:if(he!=255&&he!=28&&(he<32||he>254)||(he==255?Xe=(ve(Me,4)|0)/65536:(ue(Me,-1),Xe=(ce(Me)<<16|0)>>16),q>=48))return 0;re[q++]=Xe,Ne=0;break}Ne&&(q=0)}return 0}function Tt(){return{started:0,first_x:0,first_y:0,x:0,y:0,min_x:0,max_x:0,min_y:0,max_y:0,vertices:[]}}function Vt(S,R){var V=Tt();return Mt(S,R,V)?V.vertices:null}function Ot(S,R,V){var H=Tt(),$=Mt(S,R,H);return V.x0=$?H.min_x:0,V.y0=$?H.min_y:0,V.x1=$?H.max_x:0,V.y1=$?H.max_y:0,$&&H.vertices?H.vertices.length:0}function Ht(S,R){return S.cff.length?Vt(S,R):ut(S,R)}function Dt(S,R){var V=Fe(S.data,S.hhea+34);return R<V?{advanceWidth:xe(S.data,S.hmtx+4*R),leftSideBearing:xe(S.data,S.hmtx+4*R+2)}:{advanceWidth:xe(S.data,S.hmtx+4*(V-1)),leftSideBearing:xe(S.data,S.hmtx+4*V+2*(R-V))}}function qt(S,R){return Dt(S,Ze(S,R))}function bt(S){return{ascent:xe(S.data,S.hhea+4),descent:xe(S.data,S.hhea+6),linegap:xe(S.data,S.hhea+8)}}function yt(S,R,V,H,$,pe){var q={};return st(S,R,q)?{x0:ee(q.x0*V+$),y0:ee(-q.y1*H+pe),x1:ie(q.x1*V+$),y1:ie(-q.y0*H+pe)}:{x0:0,y0:0,x1:0,y1:0}}function wt(S,R,V,H,$,pe){return yt(S,Ze(S,R),V,H,$,pe)}function $t(S,R,V,H){return wt(S,R,V,H,0,0)}function Ft(S,R,V){var H=(S.x1-S.x0)/(S.y1-S.y0);return{fdx:H,fdy:H!=0?1/H:0,fx:S.x0+H*(V-S.y0)-(R|0),direction:S.invert?1:-1,sy:S.y0,ey:S.y1,next:0}}function dt(S,R,V,H,$,pe,q){R=R|0,$!=q&&($>V.ey||q<V.sy||($<V.sy&&(H+=(pe-H)*(V.sy-$)/(q-$),$=V.sy),q>V.ey&&(pe+=(pe-H)*(V.ey-q)/(q-$),q=V.ey),H<=R&&pe<=R?S[R]+=V.direction*(q-$):H>=R+1&&pe>=R+1||(S[R]+=V.direction*(q-$)*(1-(H-R+(pe-R))/2))))}function Wt(S,R,V,H,$){for(var pe=$+1;H;){if(H.fdx==0){var q=H.fx;q<V&&(q>=0?(dt(S,q,H,q,$,q,pe),dt(R,q+1,H,q,$,q,pe)):dt(R,0,H,q,$,q,pe))}else{var q=H.fx,be=H.fdx,O=q+be,he,Pe,Ne,re,He=H.fdy;if(H.sy>$?(he=q+be*(H.sy-$),Ne=H.sy):(he=q,Ne=$),H.ey<pe?(Pe=q+be*(H.ey-$),re=H.ey):(Pe=O,re=pe),he>=0&&Pe>=0&&he<V&&Pe<V)if((he|0)==(Pe|0)){var Ue=re-Ne,Me=he|0;S[Me]+=H.direction*(1-(he-Me+(Pe-Me))/2)*Ue,R[Me+1]+=H.direction*Ue}else{var Xe,Me,we,We,Bt,ct,tt,lt;for(he>Pe&&(Ne=pe-(Ne-$),re=pe-(re-$),Xe=Ne,Ne=re,re=Xe,Xe=Pe,Pe=he,he=Xe,be=-be,He=-He,Xe=q,q=O,O=Xe),we=he|0,We=Pe|0,Bt=(we+1-q)*He+$,tt=H.direction,lt=tt*(Bt-Ne),S[we]+=lt*(1-(he-we+(we+1-we))/2),ct=tt*He,Me=we+1;Me<We;++Me)S[Me]+=lt+ct/2,lt+=ct;Bt+=He*(We-(we+1)),S[We]+=lt+tt*(1-(We-We+(Pe-We))/2)*(re-Bt),R[We+1]+=tt*(re-Ne)}else for(var Me=0;Me<V;++Me){var kt=$,we=Me,We=Me+1,at=O,rt=pe,pt=(Me-q)/be+$,mt=(Me+1-q)/be+$;q<we&&at>We?(dt(S,Me,H,q,kt,we,pt),dt(S,Me,H,we,pt,We,mt),dt(S,Me,H,We,mt,at,rt)):at<we&&q>We?(dt(S,Me,H,q,kt,We,mt),dt(S,Me,H,We,mt,we,pt),dt(S,Me,H,we,pt,at,rt)):q<we&&at>we||at<we&&q>we?(dt(S,Me,H,q,kt,we,pt),dt(S,Me,H,we,pt,at,rt)):q<We&&at>We||at<We&&q>We?(dt(S,Me,H,q,kt,We,mt),dt(S,Me,H,We,mt,at,rt)):dt(S,Me,H,q,kt,at,rt)}}H=H.next}}function oi(S,R,V,H,$,pe){H|=0,$|=0,pe|=0;var q=null,be,O=pe,he=0,Pe,Ne=new Float32Array(S.w*2+1),re=Ne.subarray(S.w),He=0;for(R[V].y0=pe+S.h+1;he<S.h;){var Ue=O+0,Me=O+1,Xe=q;if(Ne.fill)Ne.fill(0);else for(var we=0,We=Ne.length;we<We;we++)Ne[we]=0;for(;Xe;)be=Xe,Xe=be.next,be.ey<=Ue&&(be.direction=0);for(;R[He].y0<=Me;)R[He].y0!=R[He].y1&&(be=Ft(R[He],$,Ue),be.next=q,q=be),++He;q&&Wt(Ne,re,S.w,q,Ue);for(var Pe=0,Bt=0;Pe<S.w;++Pe){var ct,tt;Bt+=re[Pe],ct=Ne[Pe]+Bt,ct=ae(ct)*255+.5,tt=ct>>>0,tt>255&&(tt=255),S.pixels[he*S.stride+Pe]=tt}for(Xe=q;Xe;)be=Xe,be.fx+=be.fdx,Xe=be.next;++O,++he}}function gi(S,R){for(var V=1;V<R;++V){for(var H=S[V],$=V;$>0&&H.y0<S[$-1].y0;)S[$]=S[$-1],--$;V!=$&&(S[$]=H)}}function fi(S,R,V){for(;V>12;){var H,$,pe,q,be,O=V>>1,he=S[R].y0<S[R+O].y0,Pe=S[R+O].y0<S[R+V-1].y0;for(he!=Pe&&($=S[R].y0<S[R+V-11].y0,be=$==Pe?0:V-1,H=S[R+be],S[R+be]=S[R+O],S[R+O]=H),H=S[R],S[R]=S[R+O],S[R+O]=H,pe=1,q=V-1;;){for(;S[R+pe].y0<S[R].y0;++pe);for(;S[R].y0<S[R+q].y0;--q);if(pe>=q)break;H=S[R+pe],S[R+pe]=S[R+q],S[R+q]=H,++pe,--q}q<V-pe?(fi(S,R,q),R+=pe,V-=pe):(fi(S,R+pe,V-pe),V=q)}}function ni(S,R){fi(S,0,R),gi(S,R)}function si(S,R,V,H,$,pe,q,be,O,he){var Pe=he?-$:$,Ne,re,He,Ue,Me,Xe,we=1;for(re=0,He=0;He<V.length;++He)re+=V[He];for(Ne=ne(re+1),re=0,Xe=0,He=0;He<V.length;++He){var We=Xe;for(Xe+=V[He],Ue=V[He]-1,Me=0;Me<V[He];Ue=Me++){var Bt=Me,ct=Ue;R[We+Ue].y!=R[We+Me].y&&(Ne[re].invert=0,(he?R[We+Ue].y>R[We+Me].y:R[We+Ue].y<R[We+Me].y)&&(Ne[re].invert=1,Bt=Ue,ct=Me),Ne[re].x0=R[We+Bt].x*H+pe,Ne[re].y0=(R[We+Bt].y*Pe+q)*we,Ne[re].x1=R[We+ct].x*H+pe,Ne[re].y1=(R[We+ct].y*Pe+q)*we,++re)}}ni(Ne,re),oi(S,Ne,re,we,be,O)}function di(S,R,V,H,$,pe,q,be,O){var he=(R+2*H+pe)/4,Pe=(V+2*$+q)/4,Ne=(R+pe)/2-he,re=(V+q)/2-Pe;return O>16||(Ne*Ne+re*re>be?(di(S,R,V,(R+H)/2,(V+$)/2,he,Pe,be,O+1),di(S,he,Pe,(H+pe)/2,($+q)/2,pe,q,be,O+1)):S.push({x:pe,y:q})),1}function Zt(S,R,V,H,$,pe,q,be,O,he,Pe){var Ne=H-R,re=$-V,He=pe-H,Ue=q-$,Me=be-pe,Xe=O-q,we=be-R,We=O-V,Bt=K(Ne*Ne+re*re)+K(He*He+Ue*Ue)+K(Me*Me+Xe*Xe),ct=K(we*we+We*We),tt=Bt*Bt-ct*ct;if(!(Pe>16))if(tt>he){var lt=(R+H)/2,kt=(V+$)/2,at=(H+pe)/2,rt=($+q)/2,pt=(pe+be)/2,mt=(q+O)/2,It=(lt+at)/2,ri=(kt+rt)/2,jt=(at+pt)/2,ui=(rt+mt)/2,Ut=(It+jt)/2,wi=(ri+ui)/2;Zt(S,R,V,lt,kt,It,ri,Ut,wi,he,Pe+1),Zt(S,Ut,wi,jt,ui,pt,mt,be,O,he,Pe+1)}else S.push({x:be,y:O})}function ai(S,R,V){for(var H=[],$=R*R,pe=-1,q=0,be=0,O=0,he=0,Pe=S.length;he<Pe;++he)switch(S[he].type){case o:pe>=0&&(V[pe]=H.length-q),++pe,q=H.length,be=S[he].x,O=S[he].y,H.push({x:be,y:O});break;case c:be=S[he].x,O=S[he].y,H.push({x:be,y:O});break;case a:di(H,be,O,S[he].cx,S[he].cy,S[he].x,S[he].y,$,0),be=S[he].x,O=S[he].y;break;case l:Zt(H,be,O,S[he].cx,S[he].cy,S[he].cx1,S[he].cy1,S[he].x,S[he].y,$,0),be=S[he].x,O=S[he].y;break}return V[pe]=H.length-q,H}function Si(S,R,V,H,$,pe,q,be,O,he){be|=0,O|=0;var Pe=H>$?$:H,Ne=[],re=ai(V,R/Pe,Ne);re&&si(S,re,Ne,H,$,pe,q,be,O,he)}function pi(S,R,V,H,$,pe,q,be,O,he){var Pe=Ht(S,he),Ne={},re=yt(S,he,pe,q,be,O);Ne.pixels=R,Ne.w=V|0,Ne.h=H|0,Ne.stride=$|0,Ne.w&&Ne.h&&Si(Ne,.35,Pe,pe,q,be,O,re.x0,re.y0,1)}function Ni(S,R,V,H,$,pe,q,be,O,he){pi(S,R,V,H,$,pe,q,be,O,Ze(S,he))}function Gt(S,R,V){return vt(S,R,V)}function ti(S){var R={};if(!vt(R,S,0))return null;var V=bt(R);return R.ascent=V.ascent,R.descent=V.descent,R.linegap=V.linegap,R}function ei(S,R,V,H){H=H||V;var $=V/S.ascent,pe=H/S.ascent,q=Ze(S,R);if(!q&&R)return null;var be=Ht(S,q),O=yt(S,q,$,pe,0,0),he=O.x1-O.x0,Pe=O.y1-O.y0,Ne=null;if(he&&Pe){var re={pixels:Ne=new Uint8Array(he*Pe),w:he,h:Pe,stride:he};Si(re,.35,be,$,pe,0,0,O.x0,O.y0,1)}var He=Dt(S,q);return{glyph:q,pixels:Ne,width:he,height:Pe,top:-O.y0,left:O.x0,advance:ee(He.advanceWidth*$)}}function Qt(S,R,V,H){H=H||V;var $=V/S.ascent,pe=H/S.ascent,q=Ze(S,R);if(!q&&R)return null;var be=Ht(S,q),O=Dt(S,q),he=0,Pe=0,Ne=[];if(be)for(var re=0,He=be.length;re<He;re++){var Ue=be[re],Me;if(Ue.type==o)Me={type:"M",x:Ue.x*$,y:Ue.y*pe};else if(Ue.type==c)Me={type:"L",x:Ue.x*$,y:Ue.y*pe};else if(Ue.type==a)Me={type:"Q",x:Ue.x*$,y:Ue.y*pe,cx:Ue.cx*$,cy:Ue.cy*pe};else if(Ue.type==l)Me={type:"C",x:Ue.x*$,y:Ue.y*pe,cx1:Ue.cx*$,cy1:Ue.cy*pe,cx2:Ue.cx1*$,cy2:Ue.cy1*pe};else continue;Me.y>he&&(he=Me.y),Me.y<Pe&&(Pe=Me.y),Ne.push(Me)}return Ne.advance=O.advanceWidth*$,Ne.ascent=he,Ne.descent=Pe,Ne}return{InitFont:ti,GetGlyph:ei,GetPaths:Qt}})();function fA(o){if(typeof o=="string"){for(var c=/[^A-Za-z0-9+\/=\s]/.test(o),a=c?o:atob(o),l=a.length,s=new Uint8Array(l),m=0;m<l;m++)s[m]=a.charCodeAt(m);return s}else{if(o instanceof Uint8Array)return o;if(o instanceof ArrayBuffer)return new Uint8Array(o)}throw new ReferenceError("data must be a binary or base64 encoded string or Uint8Array")}D1.loadFont("OCR-A",100,100,"AAEAAAAPAIAAAwBwRkZUTXxHoksAADPIAAAAHEdERUYAmQAGAAAyIAAAACBHUE9TuP+4/gAAM5gAAAAwR1NVQuq3l/0AADJAAAABWE9TLzKDm4kvAAABeAAAAGBjbWFwO6GiGgAAArgAAAFaZ2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1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAtgBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQECAQMBBAEFD3F1b3Rlc2luZ2xlLmFsdAlncmF2ZS5hbHQMcXVvdGVkYmwuYWx0B2Jhci5hbHQAAAAAAAAB//8AAgABAAAADgAAABgAAAAAAAIAAQABAGUAAQAEAAAAAgAAAAEAAAAKAEAAjgACREZMVAAObGF0bgAiAAQAAAAA//8ABQAAAAEAAgADAAQABAAAAAD//wAFAAAAAQACAAMABAAFYWFsdAAgc3MwMQAmc3MwMgAsc3MwMwAyc3MwNAA4AAAAAQAAABgAAQABABYAAQACABQAAQADABIAAQAEAAABAAAAAQEAAAECAAABAwAFAAwAFAAcACQALAADAAAAAQAoAAEAAAABAFIAAQAAAAEAVgABAAAAAQBaAAEAAAABAF4AAQAmAAQADgAUABoAIAACAAUAZAACAAoAYgACAEMAYwACAF8AZQABAAQABQAKAEMAXwABAAYAIAABAAEAQwABAAYAXwABAAEABQABAAYAWAABAAEACgABAAYABgABAAEAXwABAAAACgAsAC4AAkRGTFQADmxhdG4AGAAEAAAAAP//AAAABAAAAAD//wAAAAAAAAAAAAEAAAAAzD2izwAAAADWBtqRAAAAANoDIf0=");var eu={toCanvas:rA,toSVG:lA,render:cA,raw:dA,drawingCanvas:c2,drawingSVG:Xg,symbolList:zg,fixupOptions:Wg,loadFont:mA,FontLib:D1,BWIPJS_VERSION:aA,BWIPP_VERSION:Yg};var uA=["barcodeCanvas"],vA=()=>["/menu/Products/Catalog/Products/Info"],gA=o=>({ID:o}),bA=o=>({cursor:o}),hA=o=>({opacity:o});function xA(o,c){if(o&1){let a=Se();d(0,"button",40),de("click",function(){U(a);let s=x(2);return Q(s.onRemove())}),v(1," \xD7 "),p()}}function _A(o,c){if(o&1){let a=Se();d(0,"div",8)(1,"img",38),de("click",function(s){U(a);let m=x();return Q(m.openBigPicture(m.data().Data.Variant,s))}),p(),k(2,xA,2,0,"button",39),p()}if(o&2){let a=x(),l=Qs(8);f(),M("src",a.data().Data.Variant.ThumbnailImage,vl),f(),D(l?2:-1)}}function CA(o,c){if(o&1){let a=Se();d(0,"img",41),de("click",function(s){U(a);let m=x();return Q(m.openBigPicture(m.data().Data.Variant,s))}),p()}if(o&2){let a,l=x();M("src",(a=l.data().Data)==null||a.Variant==null?null:a.Variant.ThumbnailImage,vl)}}function yA(o,c){if(o&1){let a=Se();d(0,"div",42),de("click",function(){U(a);let s=x(),m=Qs(7);return Q(m?s.onAddImageModal():null)}),d(1,"div",43),G(2,"i",44),p()()}if(o&2){x();let a=Qs(7);M("matTooltip",a?"":"You do not have permission to upload image"),f(),M("ngStyle",ot(3,bA,a?"pointer":"not-allowed")),f(),M("ngStyle",ot(5,hA,a?"1":"0.5"))}}function wA(o,c){if(o&1){let a=Se();d(0,"i",45),de("click",function(){U(a);let s=x();return Q(s.onAddImageModal())}),p()}}function AA(o,c){if(o&1){let a=Se();d(0,"i",46),de("click",function(){U(a);let s=x();return Q(s.switchCodeType())}),p()}if(o&2){let a=x();M("matTooltip",a.codeType()==="code"?"Provide code in Hexadecimal format instead of ASCII for RFID Encoding":"Hide hexadecimal code")}}function SA(o,c){o&1&&(d(0,"div",26)(1,"label",47),v(2," Hexacode "),p()())}function IA(o,c){if(o&1){let a=Se();d(0,"div",48,0),de("click",function(s){U(a);let m=wa(1),h=x();return Q(h.openBarcodeFullscreen(s,m))}),G(2,"ngx-barcode6",49),p()}if(o&2){let a=x();f(2),M("bc-value",a.data().Data.Variant.Code)("bc-height",24)("bc-width",.4)("bc-display-value",!1)}}function kA(o,c){if(o&1&&(d(0,"div",26),G(1,"input",50),p()),o&2){let a=x();f(),M("value",a.data().Data.Variant.Hexacode)}}var _p=BiggerPicture({target:document.body}),Cp=class o{barcodeCanvas;variantTypeID=g1;prepaidCollapsed=Qe(!1);codeType=fv(()=>Qi.IsNotEmpty(this.data().Data.Variant.Hexacode)?"hexacode":"code");renderer=dn(w2);matDialog=dn(Ma);roleService=dn(yi);destroy$=new ps;barcodeRendered=Qe(!1);formVariantV2Service=dn(_d);toaster=dn(zi);imageUploadSuccess=I2();constructor(){this.initBarcode()}data=Ci();initBarcode(){ov({read:()=>{let c=this.data()?.Data?.Variant?.Code;if(!(!this.barcodeCanvas||!c)&&!this.barcodeRendered())try{let a={bcid:"code128",text:c,scale:3,height:10,includetext:!1};eu.toCanvas(this.barcodeCanvas.nativeElement,a);let l=eu.toSVG(kr({},a)),s=this.renderer.parentNode(this.barcodeCanvas.nativeElement);this.renderer.setAttribute(s,"href","data:image/svg+xml,"+encodeURIComponent(l)),this.barcodeCanvas.nativeElement.classList.contains("w-100")||this.renderer.addClass(this.barcodeCanvas.nativeElement,"w-100"),this.barcodeRendered.set(!0),console.log("Barcode rendering completed successfully.")}catch(a){console.error("Failed to render barcode:",a)}}})}openBigPicture(c,a){return nc(this,null,function*(){if(a.preventDefault(),!!c.DisplayImage)try{let l=yield xv(c.DisplayImage.replace("w_80",""));_p.open({items:[l],intro:"fadeup"})}catch(l){console.error("Failed to open BigPicture:",l)}})}openGalery(c){c.preventDefault();let a=c.target.parentElement,l=a?.attributes?.getNamedItem("href")?.value;if(l?.startsWith("data:image/svg+xml")){let s=new Blob([decodeURIComponent(l?.split(",")[1])],{type:"image/svg+xml"}),m=URL.createObjectURL(s);_p.open({items:[{img:m,height:300,width:300}],el:a,intro:"fadeup",noPinch:h=>h.clientWidth<800,maxZoom:1}),setTimeout(()=>URL.revokeObjectURL(m),5e3)}else _p.open({items:[l],el:a})}openBarcodeFullscreen(c,a){c.preventDefault();let l=a.querySelector("svg");if(!l){console.warn("No SVG element found in barcode wrapper.");return}let m=new XMLSerializer().serializeToString(l),h=new Blob([m],{type:"image/svg+xml"}),_=URL.createObjectURL(h);_p.open({items:[{img:_,height:300,width:300}],el:a,intro:"fadeup",noPinch:w=>w.clientWidth<800,maxZoom:1}),setTimeout(()=>URL.revokeObjectURL(_),5e3)}get variantName(){if(this.data()&&this.data().Data&&this.data().Data.Product){let a=`${this.data().Data.Product.Display}`;return{name:a.length>40?`${a.slice(0,40)}...`:a,tooltip:a.length>40?a:""}}return""}onRemove(){this.data().Data.Variant.Image=null,this.data().Data.Variant.ThumbnailImage=null,this.formVariantV2Service.deleteImage(this.data().Data.Variant.ID).subscribe(c=>{this.toaster.success(c.Message,Zi.Success)})}onAddImageModal(){let c=this.data().Data.CloudflareFolder;this.matDialog.open(Ml,{data:{currentProductImagesLength:0,CloudinaryFolder:c,maxNumberOfFiles:1}}).afterClosed().subscribe(l=>{this.onImageUpdated(l)})}onImageUpdated(c){this.formVariantV2Service.updateImage(this.data().Data.Variant.ID,c[0].ImageName).subscribe(a=>{a&&(this.toaster.success(a.Message,Zi.Success),this.imageUploadSuccess.emit())})}togglePrepaidCollapse(){this.prepaidCollapsed.update(c=>!c)}switchCodeType(){this.codeType.update(c=>c==="code"?"hexacode":"code")}ngOnDestroy(){this.barcodeRendered.set(!1),this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-personal-information"]],viewQuery:function(a,l){if(a&1&&ms(uA,5,oc),a&2){let s;Wl(s=Jl())&&(l.barcodeCanvas=s.first)}},inputs:{data:[1,"data"]},outputs:{imageUploadSuccess:"imageUploadSuccess"},decls:79,vars:31,consts:[["barcodeWrapper",""],[1,"row","gap-0"],[1,"col-sm-12","col-lg-8","pe-3"],[1,"card","mb-0"],[1,"card-body","py-9","px-8"],[1,"row","g-8","pb-6","mb-6","border-bottom"],[1,"col-md-2","d-flex","align-items-center","justify-content-center"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-4","px-3",2,"width","100%"],[1,"position-relative","thumbnail-image-wrapper"],["brokenImageIconFailSafe","",1,"thumbnail-image",3,"src"],["matTooltipPosition","below",1,"thumbnail-image","border-dashed",3,"matTooltip"],[1,"col-10"],[1,"row",2,"height","100%"],[1,"col-6","d-flex","align-items-center",2,"height","100%"],[2,"width","100%"],[1,"text-muted","mb-1","d-block"],["matTooltipPosition","above",1,"form-control","custom","hyperlink-pointer","text-primary",2,"pointer-events","auto",3,"routerLink","queryParams","matTooltip"],["matTooltip","Add New Variant Image","matTooltipPosition","above",1,"fa-light","fa-image-circle-plus","cursor-pointer"],["type","text","readonly","",1,"form-control","custom",3,"value"],[1,"row","g-8"],[1,"col-6","mt-6"],[1,"input-group"],[1,"row"],[1,"d-flex","gap-2","align-items-center"],["for","index",1,"text-muted","mb-1","d-block"],["matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-hexagon-plus","cursor",3,"matTooltip"],[1,"col-6","ps-1"],[1,"code-input-wrapper"],["type","text","id","index","placeholder","Code","name","Index","readonly","",1,"custom","form-control",3,"value"],[1,"barcode-inside-input"],["type","text","id","index","placeholder","Index","name","Index","readonly","",1,"custom","form-control",3,"value"],[1,"form-control","custom","d-flex","justify-content-between","align-items-center"],[1,"col-12","col-lg-4"],[1,"card","h-100","mb-0"],[1,"card-header"],[1,"fw-semibold","text-dark"],[1,"card-body","pb-9","pt-6"],[1,"d-flex","flex-column","gap-9"],["brokenImageIconFailSafe","",1,"thumbnail-image","border",3,"click","src"],["type","button","aria-label","Remove image",1,"thumbnail-remove-btn"],["type","button","aria-label","Remove image",1,"thumbnail-remove-btn",3,"click"],["brokenImageIconFailSafe","",1,"thumbnail-image",3,"click","src"],["matTooltipPosition","below",1,"thumbnail-image","border-dashed",3,"click","matTooltip"],[1,"d-flex","justify-content-center","align-items-center",2,"height","100%","width","100%",3,"ngStyle"],[1,"fa-light","fa-image-circle-plus",2,"font-size","18px",3,"ngStyle"],["matTooltip","Add New Variant Image","matTooltipPosition","above",1,"fa-light","fa-image-circle-plus","cursor-pointer",3,"click"],["matTooltipPosition","above",1,"fa-sharp","fa-thin","fa-hexagon-plus","cursor",3,"click","matTooltip"],["for","hexacode",1,"text-muted","mb-1","d-block"],[1,"barcode-inside-input",3,"click"],["bc-element-type","svg",3,"bc-value","bc-height","bc-width","bc-display-value"],["type","text","id","hexacode","placeholder","Hexacode","name","Hexacode","readonly","",1,"custom","form-control",2,"border-radius","4px","padding","10px",3,"value"]],template:function(a,l){if(a&1&&(d(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",7),Us(7)(8),k(9,_A,3,2,"div",8)(10,CA,1,1,"img",9)(11,yA,3,7,"div",10),p()(),d(12,"div",11)(13,"div",12)(14,"div",13)(15,"div",14)(16,"label",15),v(17," Parent Product "),p(),d(18,"a",16),v(19),p()()(),d(20,"div",13)(21,"div",14)(22,"label",15),v(23," Variant "),k(24,wA,1,0,"i",17),p(),G(25,"input",18),p()()()()(),d(26,"div",19)(27,"div",20)(28,"label",15),v(29,"Display Name"),p(),d(30,"div",21),G(31,"input",18),p()(),d(32,"div",20)(33,"div",22)(34,"div")(35,"div",23)(36,"label",24),v(37," Code "),p(),k(38,AA,1,1,"i",25),p()(),k(39,SA,3,0,"div",26),p(),d(40,"div",22)(41,"div")(42,"div",27),G(43,"input",28),k(44,IA,3,4,"div",29),p()(),k(45,kA,2,1,"div",26),p()(),d(46,"div",20)(47,"label",24),v(48,"Loyalty Point Enabled"),p(),G(49,"input",30),p(),d(50,"div",20)(51,"label",15),v(52,"Taxable"),p(),d(53,"div",31)(54,"span"),v(55),p()()()()()()(),d(56,"div",32)(57,"div",33)(58,"div",34)(59,"h5",35),v(60,"Properties"),p()(),d(61,"div",36)(62,"div",37)(63,"div")(64,"label",15),v(65,"Type"),p(),d(66,"div",31)(67,"span"),v(68),p()()(),d(69,"div")(70,"label",15),v(71,"Payment Type"),p(),G(72,"input",18),p(),d(73,"div")(74,"label",15),v(75,"Status"),p(),d(76,"div",31)(77,"span"),v(78),p()()()()()()()()),a&2){let s,m,h=l.data().Data.Variant.ThumbnailImage;f(7);let _=sc(l.roleService==null||l.roleService.product==null?null:l.roleService.product.ImageEditor);f();let w=sc(l.data().Data.Variant.VariantImageVisible);f(),D(h&&_?9:h&&!_?10:h?-1:11),f(9),M("routerLink",ft(28,vA))("queryParams",ot(29,gA,l.data().Data.Variant.ProductID))("matTooltip",l.variantName.tooltip),f(),oe(" ",l.variantName.name," "),f(5),D(!w&&(l.data().Data.Variant.Image.trim()!==""||l.data().Data.Variant.Image)?24:-1),f(),M("value",l.data().Data.Variant.Model),f(6),M("value",l.data().Data.Variant.Name),f(3),Jo(l.codeType()==="code"?"col-12":"col-6 pe-2"),f(4),D(l.data().Data.Variant.Hexacode&&l.data().Data.Variant.Hexacode!==null&&l.data().Data.Variant.Hexacode!==void 0&&((s=l.data())==null||s.Data==null||s.Data.Variant==null||s.Data.Variant.Hexacode==null?null:s.Data.Variant.Hexacode.trim())!==""?38:-1),f(),D(l.codeType()==="hexacode"?39:-1),f(2),Jo(l.codeType()==="code"?"col-12":"col-6 pe-2"),f(2),Kl("padding-right",l.codeType()!=="hexacode"?110:null,"px"),M("value",l.data().Data.Variant.Code),f(),D(!((m=l.data().Data)==null||m.Variant==null)&&m.Variant.Code?44:-1),f(),D(l.codeType()==="hexacode"?45:-1),f(4),M("value",l.data().Data.Variant.LoyaltyPoint?"Yes":"No"),f(6),oe(" ",l.data().Data.Variant.Taxable?"Yes":"No"," "),f(13),Ae(l.data().Data.Variant.VariantType),f(4),M("value",l.data().Data.Variant.PaymentTypeString),f(4),hr("text-danger",l.data().Data.Variant.Discontinued),f(2),oe(" ",l.data().Data.Variant.Discontinued?"Discontinued":"Active"," ")}},dependencies:[li,nr,Ei,tr,M2,mc,kl,tg],styles:[".thumbnail-image[_ngcontent-%COMP%]{width:90px;height:90px;object-fit:cover;cursor:pointer;background-color:#fafafa}.code-input-wrapper[_ngcontent-%COMP%]{position:relative}.barcode-inside-input[_ngcontent-%COMP%]{position:absolute;right:4px;top:38%;transform:translateY(-50%);cursor:pointer;height:26px;overflow:hidden;line-height:0}.barcode-inside-input[_ngcontent-%COMP%]:hover{opacity:.8}.thumbnail-image-wrapper[_ngcontent-%COMP%] .thumbnail-remove-btn[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;border:none;background:#dc2626d9;color:#fff;font-size:.75rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s}.thumbnail-image-wrapper[_ngcontent-%COMP%]:hover .thumbnail-remove-btn[_ngcontent-%COMP%]{opacity:1}.border-dashed[_ngcontent-%COMP%]{border:1.5px dashed #d1d5db}.cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}.select-none[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.transition-rotate[_ngcontent-%COMP%]{transition:transform .2s ease;font-size:.75rem}.transition-rotate.rotated[_ngcontent-%COMP%]{transform:rotate(90deg)}",".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var tu=()=>["/menu/Products/Log/Variant_History"],iu=o=>({VariantID:o});function DA(o,c){if(o&1&&(d(0,"span",17),v(1),p()),o&2){let a=x(2);f(),oe(" ",a.data().Data.Variant.CostCurrencySymbol," ")}}function MA(o,c){if(o&1&&(d(0,"div",7)(1,"label",9),v(2," Buying Cost "),p(),d(3,"a",10),k(4,DA,2,1,"span",17),v(5),F(6,"number"),p()()),o&2){let a=x();f(3),M("routerLink",ft(8,tu))("queryParams",ot(9,iu,a.data().Data.Variant.ID))("ngClass",a.showCostCurrencySymbol?"ps-10":""),f(),D(a.showCostCurrencySymbol?4:-1),f(),oe(" ",Ie(6,5,a.data().Data.Variant.UnitCost,"1.0-4")," ")}}function EA(o,c){if(o&1&&(d(0,"span",17),v(1),p()),o&2){let a=x(2);f(),oe(" ",a.data().Data.Variant.PriceCurrencySymbol," ")}}function TA(o,c){if(o&1&&(d(0,"div",7)(1,"label",18),v(2," Selling Price "),p(),d(3,"div",19)(4,"a",20),k(5,EA,2,1,"span",17),v(6),F(7,"number"),p()()()),o&2){let a=x();f(4),M("routerLink",ft(7,tu))("queryParams",ot(8,iu,a.data().Data.Variant.ID))("ngClass",a.showPriceCurrencySymbol?"ps-10":""),f(),D(a.showPriceCurrencySymbol?5:-1),f(),oe(" ",Ce(7,5,a.data().Data.Variant.UnitPrice)," ")}}function PA(o,c){if(o&1&&(d(0,"span",23),v(1),p()),o&2){let a=x(2);f(),oe(" -",a.data().Data.Variant.OrderPriceDiscount,"% ")}}function BA(o,c){if(o&1&&(d(0,"div",7)(1,"label",18),v(2," Last Buy Cost "),p(),d(3,"div",21),G(4,"input",22),F(5,"number"),k(6,PA,2,1,"span",23),p()()),o&2){let a=x();f(4),M("value",Ie(5,3,a.data().Data.Variant.OrderPrice,"1.0-4"))("ngClass",a.data().Data.Variant.OrderPriceDiscount>0?"no-border-right":""),f(2),D(a.data().Data.Variant.OrderPriceDiscount>0?6:-1)}}function NA(o,c){if(o&1&&(d(0,"div",8)(1,"label",9),v(2," Maximum Buy Cost "),p(),G(3,"input",24),F(4,"number"),p()),o&2){let a=x();f(3),M("value",Ce(4,1,a.data().Data.Variant.MaxOrderPrice))}}var yp=class o{roleService=dn(yi);helpCenterUrl="https://support.dealpos.com/en/";data=Ci();priceFormExpanded=y1(!1);outletPriceVisible=y1(!1);get showCostCurrencySymbol(){let c=this.data().Data.Currencies.find(a=>a.Primary===!0);return this.data().Data.Currencies.length>1&&c.ID!==this.data().Data.Variant.CostCurrencyID}get showPriceCurrencySymbol(){let c=this.data().Data.Currencies.find(a=>a.Primary===!0);return this.data().Data.Currencies.length>1&&c.ID!==this.data().Data.Variant.PriceCurrencyID}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-cost-and-price"]],inputs:{data:[1,"data"],priceFormExpanded:[1,"priceFormExpanded"],outletPriceVisible:[1,"outletPriceVisible"]},outputs:{priceFormExpanded:"priceFormExpandedChange",outletPriceVisible:"outletPriceVisibleChange"},decls:34,vars:25,consts:[[1,"card","mb-0","mt-4"],[1,"card-body","py-6"],[1,"d-flex","align-items-center","gap-2","mb-3"],[1,"fw-semibold","text-dark"],["matTooltipPosition","above","data-bs-toggle","collapse","data-bs-target","#collapseExample","aria-expanded","false","aria-controls","collapseExample",1,"cursor-pointer","d-flex","align-items-center",3,"click","matTooltip"],[1,"fas","fa-circle-chevron-up","text-muted","expand-icon"],[1,"row","g-6"],[1,"col-12","col-md-4"],[1,"col-12","col-md-3"],[1,"text-muted","mb-1","d-block"],["matTooltip","The current unit cost of products, auto-calculated by the system.","matTooltipPosition","above",1,"form-control","position-relative","custom","text-body","hyperlink-pointer","d-flex","align-items-center",2,"pointer-events","auto",3,"routerLink","queryParams","ngClass"],[1,"col-6","mt-6",3,"ngClass"],["type","text","readonly","",1,"form-control","custom",3,"value"],["id","collapseExample",1,"collapse","mt-4"],["matTooltip","The minimum price that a restricted user can adjust on sell & estimate form","matTooltipPosition","above","readonly","",1,"form-control","custom",3,"value"],[1,"col-12","col-md-1"],["type","text","matTooltip","The variant weight for one quantity","matTooltipPosition","above","readonly","",1,"form-control","custom",3,"value"],[1,"text-muted","me-1","currency-wrapper","d-flex","justify-content-center","align-items-center"],[1,"text-muted","d-block"],[1,"input-group"],["matTooltip","The price at which this product being offered for sale","matTooltipPosition","above",1,"form-control","position-relative","custom","hyperlink-pointer","d-flex","align-items-center",2,"pointer-events","auto",3,"routerLink","queryParams","ngClass"],[1,"d-flex","align-items-center"],["type","text","matTooltip","The last purchase cost from the supplier (excluding percentage discounts).","matTooltipPosition","above","readonly","",1,"form-control","custom",3,"value","ngClass"],["matTooltip","The last percentage discount received from the supplier.","matTooltipPosition","above",1,"form-control","custom","addons-form-control","text-danger",2,"background-color","#e9ecf0","text-wrap","nowrap","white-space","nowrap"],["matTooltip","The maximum buy cost that a restricted user can adjust on buy form","matTooltipPosition","above","readonly","",1,"form-control","custom",3,"value"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"h5",3),v(4,"Cost & Price"),p(),d(5,"div",4),de("click",function(){return l.priceFormExpanded.set(!l.priceFormExpanded())}),G(6,"i",5),p()(),d(7,"div",6),k(8,MA,7,11,"div",7),d(9,"div",8)(10,"label",9),v(11," Landed Cost "),p(),d(12,"a",10),v(13),F(14,"number"),p()(),k(15,TA,8,10,"div",7),d(16,"div",11)(17,"label",9),v(18," Discount "),p(),G(19,"input",12),p()(),d(20,"div",13)(21,"div",6),k(22,BA,7,6,"div",7),k(23,NA,5,3,"div",8),d(24,"div",7)(25,"label",9),v(26," Minimum Sell Price "),p(),G(27,"input",14),F(28,"number"),p(),d(29,"div",15)(30,"label",9),v(31," Weight (gr) "),p(),G(32,"input",16),F(33,"number"),p()()()()()),a&2&&(f(5),M("matTooltip",l.priceFormExpanded()?"Collapse":"Expand"),f(),hr("expanded",!l.priceFormExpanded()),f(2),D(l.roleService!=null&&l.roleService.product.Cost?8:-1),f(4),M("routerLink",ft(22,tu))("queryParams",ot(23,iu,l.data().Data.Variant.ID))("ngClass",l.showCostCurrencySymbol?"ps-10":""),f(),oe(" ",Ie(14,15,l.data().Data.Variant.LandedCost,"1.0-4")," "),f(2),D(l.roleService!=null&&l.roleService.sell.PriceVisible?15:-1),f(),M("ngClass",l.roleService!=null&&l.roleService.product.Cost?"col-md-1":"col-md-4"),f(3),M("value",l.data().Data.Variant.PriceDiscount>0?l.data().Data.Variant.PriceDiscount+"%":"0"),f(3),D(l.outletPriceVisible()?22:-1),f(),D(l.roleService!=null&&l.roleService.product.Cost?23:-1),f(4),M("value",Ce(28,18,l.data().Data.Variant.UnitPriceMinimum)),f(5),M("value",Ce(33,20,l.data().Data.Variant.Weight)))},dependencies:[tr,Jr,li,nr,Ei,Li],styles:[".currency-wrapper[_ngcontent-%COMP%]{border:1px solid #dfe2e6;position:absolute;left:0;top:0;bottom:0;width:30px;background-color:#dfe2e6}.ps-10[_ngcontent-%COMP%]{padding-left:2.2rem!important}",".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var FA=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],$g=o=>({ID:o}),VA=()=>["/menu/Contacts/Contact/Customers/Info"];function RA(o,c){o&1&&(d(0,"th",3),v(1,"Unit Cost"),p())}function OA(o,c){o&1&&(d(0,"th",3),v(1,"Price"),p())}function UA(o,c){if(o&1&&(d(0,"td",3),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),Ae(Ce(2,1,a.UnitCost))}}function QA(o,c){if(o&1&&(d(0,"td",3),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPrice)," ")}}function jA(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td"),v(4),F(5,"date"),p(),d(6,"td")(7,"a",5),v(8),p()(),d(9,"td")(10,"a",5),v(11),p()(),d(12,"td"),v(13),F(14,"number"),p(),k(15,UA,3,3,"td",3),k(16,QA,3,3,"td",3),p()),o&2){let a=c.$implicit,l=x(2);f(2),Ae(a.EntityName),f(2),Ae(Ie(5,11,a.Date,"dd/MM/yy")),f(3),M("routerLink",ft(16,FA))("queryParams",ot(17,$g,a.ID)),f(),Ae(a.Number),f(2),M("routerLink",ft(19,VA))("queryParams",ot(20,$g,a.CustomerID)),f(),Ae(a.CustomerName),f(2),Ae(Ce(14,14,a.Quantity)),f(2),D(l.role.product.Cost?15:-1),f(),D(!(l.role==null||l.role.sell==null)&&l.role.sell.PriceVisible?16:-1)}}function LA(o,c){if(o&1&&Jt(0,jA,17,22,"tr",null,vi),o&2){let a=x();Kt(a.salesHistory())}}function HA(o,c){if(o&1&&(d(0,"tr",4)(1,"td",6),G(2,"empty-state-table"),p()()),o&2){let a=x(),l=a.role.sell!=null&&a.role.sell.PriceVisible&&(a.role.product!=null&&a.role.product.Cost)?7:a.role.sell!=null&&a.role.sell.PriceVisible||a.role.product!=null&&a.role.product.Cost?6:5;f(),M("colSpan",l)}}var wp=class o{variantId=Ci();salesHistory=Ci();role=dn(yi);constructor(){console.log("SalesHistoryTableComponent initialized")}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["sales-history-table"]],inputs:{variantId:[1,"variantId"],salesHistory:[1,"salesHistory"]},decls:19,vars:3,consts:[[1,"d-flex","align-items-center"],[1,"table","mt-5"],[1,"table-light"],[1,"text-end"],[1,"border-bottom-0"],["target","_blank",3,"routerLink","queryParams"],[1,"border-bottom-0",3,"colSpan"]],template:function(a,l){if(a&1&&(G(0,"div",0),d(1,"table",1)(2,"thead")(3,"tr",2)(4,"th"),v(5,"Outlet"),p(),d(6,"th"),v(7,"Date"),p(),d(8,"th"),v(9,"Number"),p(),d(10,"th"),v(11,"Customer"),p(),d(12,"th"),v(13,"Qty"),p(),k(14,RA,2,0,"th",3),k(15,OA,2,0,"th",3),p()(),d(16,"tbody"),k(17,LA,2,0)(18,HA,3,1,"tr",4),p()()),a&2){let s;f(14),D(l.role.product!=null&&l.role.product.Cost?14:-1),f(),D(l.role.sell!=null&&l.role.sell.PriceVisible?15:-1),f(2),D(((s=l.salesHistory())==null?null:s.length)>0?17:18)}},dependencies:[tr,v1,li,Dl,nr,Li,Vn],encapsulation:2,changeDetection:0})};var qA=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Zg=o=>({ID:o}),GA=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"];function zA(o,c){o&1&&(d(0,"th",3),v(1,"Cost"),p())}function YA(o,c){if(o&1&&(d(0,"td",3),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.UnitPrice)," ")}}function WA(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td"),v(4),F(5,"date"),p(),d(6,"td")(7,"a",5),v(8),p()(),d(9,"td")(10,"a",5),v(11),p()(),d(12,"td"),v(13),F(14,"number"),p(),k(15,YA,3,3,"td",3),p()),o&2){let a=c.$implicit,l=x(2);f(2),Ae(a.EntityName),f(2),Ae(Ie(5,10,a.Date,"dd/MM/yy")),f(3),M("routerLink",ft(15,qA))("queryParams",ot(16,Zg,a.ID)),f(),Ae(a.Number),f(2),M("routerLink",ft(18,GA))("queryParams",ot(19,Zg,a.SupplierID)),f(),Ae(a.SupplierName),f(2),Ae(Ce(14,13,a.Quantity)),f(2),D(l.role.product.Cost?15:-1)}}function JA(o,c){if(o&1&&Jt(0,WA,16,21,"tr",null,J1),o&2){let a=x();Kt(a.purchaseHistory())}}function KA(o,c){if(o&1&&(d(0,"tr",4)(1,"td",6),G(2,"empty-state-table"),p()()),o&2){let a=x();f(),M("colSpan",a.role.product.Cost?5:3)}}var Ap=class o{variantId=Ci();purchaseHistory=Ci();role=dn(yi);static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["purchase-history-table"]],inputs:{variantId:[1,"variantId"],purchaseHistory:[1,"purchaseHistory"]},decls:18,vars:2,consts:[[1,"d-flex","align-items-center"],[1,"table","mt-5"],[1,"table-light"],[1,"text-end"],[1,"border-bottom-0"],["target","_blank",3,"routerLink","queryParams"],[1,"border-bottom-0",3,"colSpan"]],template:function(a,l){if(a&1&&(G(0,"div",0),d(1,"table",1)(2,"thead")(3,"tr",2)(4,"th"),v(5,"Outlet"),p(),d(6,"th"),v(7,"Date"),p(),d(8,"th"),v(9,"Number"),p(),d(10,"th"),v(11,"Supplier"),p(),d(12,"th"),v(13,"Qty"),p(),k(14,zA,2,0,"th",3),p()(),d(15,"tbody"),k(16,JA,2,0)(17,KA,3,1,"tr",4),p()()),a&2){let s;f(14),D(l.role.product.Cost?14:-1),f(2),D(((s=l.purchaseHistory())==null?null:s.length)>0?16:17)}},dependencies:[tr,v1,li,Dl,nr,Li,Vn],encapsulation:2,changeDetection:0})};var XA=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],$A=o=>({ID:o});function ZA(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td"),v(4),p(),d(5,"td"),v(6),F(7,"date"),p(),d(8,"td")(9,"a",4),v(10),p()(),d(11,"td"),v(12),F(13,"number"),p()()),o&2){let a=c.$implicit;f(2),oe(" ",a.Source," "),f(2),oe(" ",a.Destination," "),f(2),Ae(Ie(7,7,a.Date,"dd/MM/yy")),f(3),M("routerLink",ft(12,XA))("queryParams",ot(13,$A,a.ID)),f(),Ae(a.Number),f(2),Ae(Ce(13,10,a.Quantity))}}function e7(o,c){if(o&1&&Jt(0,ZA,14,15,"tr",null,J1),o&2){let a=x();Kt(a.transferOrderHistory())}}function t7(o,c){o&1&&(d(0,"tr",3)(1,"td",5),G(2,"empty-state-table"),p()()),o&2&&(f(),M("colSpan",5))}var Sp=class o{variantId=Ci();transferOrderHistory=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["transfer-order-history-table"]],inputs:{variantId:[1,"variantId"],transferOrderHistory:[1,"transferOrderHistory"]},decls:17,vars:1,consts:[[1,"d-flex","align-items-center"],[1,"table","mt-5"],[1,"table-light"],[1,"border-bottom-0"],["target","_blank",3,"routerLink","queryParams"],[1,"border-bottom-0",3,"colSpan"]],template:function(a,l){if(a&1&&(G(0,"div",0),d(1,"table",1)(2,"thead")(3,"tr",2)(4,"th"),v(5,"Outlet"),p(),d(6,"th"),v(7,"Destination"),p(),d(8,"th"),v(9,"Date"),p(),d(10,"th"),v(11,"Number"),p(),d(12,"th"),v(13,"Qty"),p()()(),d(14,"tbody"),k(15,e7,2,0)(16,t7,3,1,"tr",3),p()()),a&2){let s;f(15),D(((s=l.transferOrderHistory())==null?null:s.length)>0?15:16)}},dependencies:[tr,v1,li,Dl,nr,Li,Vn],encapsulation:2,changeDetection:0})};var i7=()=>["/menu/Orders/Order/Sales_Order/Info"],n7=o=>({ID:o});function a7(o,c){o&1&&(d(0,"th",3),v(1,"Price"),p())}function r7(o,c){if(o&1&&(d(0,"td",3),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),Ae(Ce(2,1,a.UnitPrice))}}function o7(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td"),v(4),F(5,"date"),p(),d(6,"td")(7,"a",5),v(8),p()(),d(9,"td"),v(10),F(11,"number"),p(),k(12,r7,3,3,"td",3),p()),o&2){let a=c.$implicit,l=x(2);f(2),Ae(a.EntityName),f(2),Ae(Ie(5,7,a.Date,"dd/MM/yy")),f(3),M("routerLink",ft(12,i7))("queryParams",ot(13,n7,a.ID)),f(),Ae(a.Number),f(2),Ae(Ce(11,10,a.Quantity)),f(2),D(l.role.sell!=null&&l.role.sell.PriceVisible?12:-1)}}function l7(o,c){if(o&1&&Jt(0,o7,13,15,"tr",null,J1),o&2){let a=x();Kt(a.parkedHistory())}}function s7(o,c){if(o&1&&(d(0,"tr",4)(1,"td",6),G(2,"empty-state-table"),p()()),o&2){let a=x();f(),M("colSpan",a.role.sell!=null&&a.role.sell.PriceVisible?5:3)}}var Ip=class o{variantId=Ci();parkedHistory=Ci();role=dn(yi);static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["parked-history-table"]],inputs:{variantId:[1,"variantId"],parkedHistory:[1,"parkedHistory"]},decls:16,vars:2,consts:[[1,"d-flex","align-items-center"],[1,"table","mt-5"],[1,"table-light"],[1,"text-end"],[1,"border-bottom-0"],["target","_blank",3,"routerLink","queryParams"],[1,"border-bottom-0",3,"colSpan"]],template:function(a,l){if(a&1&&(G(0,"div",0),d(1,"table",1)(2,"thead")(3,"tr",2)(4,"th"),v(5,"Outlet"),p(),d(6,"th"),v(7,"Date"),p(),d(8,"th"),v(9,"Number"),p(),d(10,"th"),v(11,"Qty"),p(),k(12,a7,2,0,"th",3),p()(),d(13,"tbody"),k(14,l7,2,0)(15,s7,3,1,"tr",4),p()()),a&2){let s;f(12),D(l.role.sell!=null&&l.role.sell.PriceVisible?12:-1),f(2),D(((s=l.parkedHistory())==null?null:s.length)>0?14:15)}},dependencies:[tr,v1,li,Dl,nr,Li,Vn],encapsulation:2,changeDetection:0})};var c7=()=>["/menu/Adjustment/Adjustment/Archive/Info"],d7=o=>({ID:o});function p7(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td"),v(4),F(5,"date"),p(),d(6,"td")(7,"a",4),v(8),p()(),d(9,"td"),v(10),F(11,"number"),p()()),o&2){let a=c.$implicit;f(2),Ae(a.EntityName),f(2),Ae(Ie(5,6,a.Date,"dd/MM/yy")),f(3),M("routerLink",ft(11,c7))("queryParams",ot(12,d7,a.ID)),f(),Ae(a.Number),f(2),Ae(Ce(11,9,a.Quantity))}}function m7(o,c){if(o&1&&Jt(0,p7,12,14,"tr",null,J1),o&2){let a=x();Kt(a.adjustmentHistory())}}function f7(o,c){o&1&&(d(0,"tr",3)(1,"td",5),G(2,"empty-state-table"),p()()),o&2&&(f(),M("colSpan",5))}var kp=class o{variantId=Ci();adjustmentHistory=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["adjustment-history-table"]],inputs:{variantId:[1,"variantId"],adjustmentHistory:[1,"adjustmentHistory"]},decls:15,vars:1,consts:[[1,"d-flex","align-items-center"],[1,"table","mt-5"],[1,"table-light"],[1,"border-bottom-0"],["target","_blank",3,"routerLink","queryParams"],[1,"border-bottom-0",3,"colSpan"]],template:function(a,l){if(a&1&&(G(0,"div",0),d(1,"table",1)(2,"thead")(3,"tr",2)(4,"th"),v(5,"Outlet"),p(),d(6,"th"),v(7,"Date"),p(),d(8,"th"),v(9,"Number"),p(),d(10,"th"),v(11,"Qty"),p()()(),d(12,"tbody"),k(13,m7,2,0)(14,f7,3,1,"tr",3),p()()),a&2){let s;f(13),D(((s=l.adjustmentHistory())==null?null:s.length)>0?13:14)}},dependencies:[tr,v1,li,Dl,nr,Li,Vn],encapsulation:2,changeDetection:0})};var u7=()=>["0"],v7=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],nu=o=>({VariantID:o}),g7=()=>["/menu/Reports/Purchases_Report/History"],b7=()=>["/menu/Adjustment/History/Variant"],e4=o=>({ID:o}),h7=()=>["/menu/Logistics/Report/Transfer/Product"],x7=()=>["/menu/Orders/Order/Parked_Order"];function _7(o,c){if(o&1&&(d(0,"div",9),v(1," ("),d(2,"a",11),de("click",function(l){return l.stopPropagation()}),v(3," Show All "),p(),v(4,") "),p()),o&2){let a=x(2);f(2),M("routerLink",ft(2,v7))("queryParams",ot(3,nu,a.variantId()))}}function C7(o,c){if(o&1&&(d(0,"p-accordion-panel",3)(1,"p-accordion-header")(2,"div",8),v(3," Sales History "),k(4,_7,5,5,"div",9),F(5,"async"),p()(),d(6,"p-accordion-content"),G(7,"sales-history-table",10),F(8,"async"),p()()),o&2){let a,l=x(),s=wa(2);f(4),D(((a=Ce(5,3,l.salesHistory$))==null?null:a.length)>0&&l.isExpanded("0",s)?4:-1),f(3),M("salesHistory",Ce(8,5,l.salesHistory$))("variantId",l.variantId())}}function y7(o,c){if(o&1&&(d(0,"div",9),v(1," ("),d(2,"a",11),de("click",function(l){return l.stopPropagation()}),v(3," Show All "),p(),v(4,") "),p()),o&2){let a=x(2);f(2),M("routerLink",ft(2,g7))("queryParams",ot(3,nu,a.variantId()))}}function w7(o,c){if(o&1&&(d(0,"p-accordion-panel",4)(1,"p-accordion-header")(2,"div",8),v(3," Purchase History "),k(4,y7,5,5,"div",9),F(5,"async"),p()(),d(6,"p-accordion-content"),G(7,"purchase-history-table",12),F(8,"async"),p()()),o&2){let a,l=x(),s=wa(2);f(4),D(((a=Ce(5,3,l.purchaseHistory$))==null?null:a.length)>0&&l.isExpanded("1",s)?4:-1),f(3),M("purchaseHistory",Ce(8,5,l.purchaseHistory$))("variantId",l.variantId())}}function A7(o,c){if(o&1&&(d(0,"div",9),v(1," ("),d(2,"a",11),de("click",function(l){return l.stopPropagation()}),v(3," Show All "),p(),v(4,") "),p()),o&2){let a=x(2);f(2),M("routerLink",ft(2,b7))("queryParams",ot(3,e4,a.variantId()))}}function S7(o,c){if(o&1&&(d(0,"p-accordion-panel",5)(1,"p-accordion-header")(2,"div",8),v(3," Adjustment History "),k(4,A7,5,5,"div",9),F(5,"async"),p()(),d(6,"p-accordion-content"),G(7,"adjustment-history-table",13),F(8,"async"),p()()),o&2){let a,l=x(),s=wa(2);f(4),D(((a=Ce(5,3,l.adjustmentHistory$))==null?null:a.length)>0&&l.isExpanded("2",s)?4:-1),f(3),M("adjustmentHistory",Ce(8,5,l.adjustmentHistory$))("variantId",l.variantId())}}function I7(o,c){if(o&1&&(d(0,"div",9),v(1," ("),d(2,"a",11),de("click",function(l){return l.stopPropagation()}),v(3," Show All "),p(),v(4,") "),p()),o&2){let a=x(2);f(2),M("routerLink",ft(2,h7))("queryParams",ot(3,e4,a.variantId()))}}function k7(o,c){if(o&1&&(d(0,"p-accordion-panel",6)(1,"p-accordion-header")(2,"div",8),v(3," Transfer Order History "),k(4,I7,5,5,"div",9),F(5,"async"),p()(),d(6,"p-accordion-content"),G(7,"transfer-order-history-table",14),F(8,"async"),p()()),o&2){let a,l=x(),s=wa(2);f(4),D(((a=Ce(5,3,l.transferOrderHistory$))==null?null:a.length)>0&&l.isExpanded("3",s)?4:-1),f(3),M("transferOrderHistory",Ce(8,5,l.transferOrderHistory$))("variantId",l.variantId())}}function D7(o,c){if(o&1&&(d(0,"div",9),v(1," ("),d(2,"a",11),de("click",function(l){return l.stopPropagation()}),v(3," Show All "),p(),v(4,") "),p()),o&2){let a=x(2);f(2),M("routerLink",ft(2,x7))("queryParams",ot(3,nu,a.variantId()))}}function M7(o,c){if(o&1&&(d(0,"p-accordion-panel",7)(1,"p-accordion-header")(2,"div",8),v(3," Parked Order History "),k(4,D7,5,5,"div",9),F(5,"async"),p()(),d(6,"p-accordion-content"),G(7,"parked-history-table",15),F(8,"async"),p()()),o&2){let a,l=x(),s=wa(2);f(4),D(((a=Ce(5,3,l.parkedHistory$))==null?null:a.length)>0&&l.isExpanded("4",s)?4:-1),f(3),M("parkedHistory",Ce(8,5,l.parkedHistory$))("variantId",l.variantId())}}var ws=class o{httpService=dn(ki);role=dn(yi);variantId=Ci();salesHistory$;purchaseHistory$;transferOrderHistory$;parkedHistory$;adjustmentHistory$;constructor(){rc(()=>{this.salesHistory$=this.httpService.get("/api/catalog/variant/SalesHistory",[{key:"ID",value:this.variantId()}]).pipe(xo(1))})}fetchHistory(c){console.log(c),c.index==1?this.purchaseHistory$||(this.purchaseHistory$=this.httpService.get("/api/catalog/variant/PurchaseHistory",[{key:"ID",value:this.variantId()}]).pipe(xo(1))):c.index==3?this.transferOrderHistory$||(this.transferOrderHistory$=this.httpService.get("/api/catalog/variant/TransferOrderHistory",[{key:"ID",value:this.variantId()}]).pipe(xo(1))):c.index==4?this.parkedHistory$||(this.parkedHistory$=this.httpService.get("/api/catalog/variant/parkorderhistory",[{key:"ID",value:this.variantId()}]).pipe(xo(1))):c.index==2&&(this.adjustmentHistory$||(this.adjustmentHistory$=this.httpService.get("/api/catalog/variant/AdjustmentHistory",[{key:"ID",value:this.variantId()}]).pipe(xo(1))))}isExpanded(c,a){return a.value().includes(c)}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-history"]],inputs:{variantId:[1,"variantId"]},decls:8,vars:8,consts:[["accordion",""],[1,"container-fluid","mt-8","d-flex","flex-column","row-gap-8"],[3,"onOpen","value","multiple"],["value","0"],["value","1"],["value","2"],["value","3"],["value","4"],[1,"d-flex"],[1,"ms-3"],[3,"salesHistory","variantId"],["target","_blank",1,"text-sm",3,"click","routerLink","queryParams"],[3,"purchaseHistory","variantId"],[3,"adjustmentHistory","variantId"],[3,"transferOrderHistory","variantId"],[3,"parkedHistory","variantId"]],template:function(a,l){a&1&&(d(0,"div",1)(1,"p-accordion",2,0),de("onOpen",function(m){return l.fetchHistory(m)}),k(3,C7,9,7,"p-accordion-panel",3),k(4,w7,9,7,"p-accordion-panel",4),k(5,S7,9,7,"p-accordion-panel",5),k(6,k7,9,7,"p-accordion-panel",6),k(7,M7,9,7,"p-accordion-panel",7),p()()),a&2&&(f(),M("value",ft(7,u7))("multiple",!0),f(2),D(!(l.role==null||l.role.report==null)&&l.role.report.View?3:-1),f(),D(!(l.role==null||l.role.report==null)&&l.role.report.View?4:-1),f(),D(!(l.role==null||l.role.adjustment==null)&&l.role.adjustment.View?5:-1),f(),D(!(l.role==null||l.role.logistic==null)&&l.role.logistic.View?6:-1),f(),D(!(l.role==null||l.role.order==null)&&l.role.order.View?7:-1))},dependencies:[tr,nr,wp,Ap,Sp,Ip,kp,yg,Cg,hg,xg,_g,v1,li,w1],encapsulation:2,changeDetection:0})};var Dp=class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=lc({type:o});static \u0275inj=ac({imports:[gs,cd,Gv,id,yd,Id,Ac,Ac,nr,hc,tr,bc,Qc,Xo,dd,mc,P2,N2,V2,R2,O2,md,F2,L2,H2,q2,$o,fc,B2,Xr,Co,fd,K2,sd,il,fc,bd,Cc,nd,Kr,hd,vd,_c,gd,td,k1,Zo,pd,yc,ed,ad,$2,Ic,kc,ws,Sd,Ml,tl,od,kd,xd,ud,Sc,rd,Dd,Z2]})};var Mp=class o{constructor(c,a,l){this.dialogRef=c;this.data=a;this.toastr=l;this.modalConfig.update(s=>(s.title="Daily Sales",s.customWidth="250px",s)),this.lastDays.set(a)}dialogRef;data;toastr;modalConfig=Qe(new K1);lastDays=Qe(0);ngOnInit(){}onOk(){if(Qi.IsEmpty(this.lastDays())){this.toastr.warning("This field Can't be blank","Warning");return}this.dialogRef.close(this.lastDays())}onCancel(){this.dialogRef.close()}static \u0275fac=function(a){return new(a||o)(se(X1),se($1),se(zi))};static \u0275cmp=nt({type:o,selectors:[["app-modal-update-days"]],standalone:!1,decls:6,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"form-floating-outline"],["type","text","data-cy","lastDays","id","lastDays","name","lastDays","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","lastDays"]],template:function(a,l){a&1&&(d(0,"modal-material",0),de("onOk",function(){return l.onOk()})("onCancel",function(){return l.onCancel()})("onClose",function(){return l.onCancel()}),d(1,"content")(2,"div",1)(3,"input",2),je("ngModelChange",function(m){return Oe(l.lastDays,m)||(l.lastDays=m),m}),p(),d(4,"label",3),v(5,"Number Of Days"),p()()()()),a&2&&(M("config",l.modalConfig()),f(3),Le("ngModel",l.lastDays))},dependencies:[Xo,Cn,Vi,Ri,_o],encapsulation:2,changeDetection:0})};var Ep=class o{constructor(c,a,l){this.el=c;this.renderer=a;this.ngZone=l}el;renderer;ngZone;stickyTop=60;stickyEnabled=!0;observer=null;stickyClone=null;sentinel=null;tableResizeObserver=null;skipInitialObserverCallback=!0;ngAfterViewInit(){if(!this.stickyEnabled)return;let c=this.el.nativeElement,a=c.querySelector("thead");if(!a)return;this.sentinel=this.renderer.createElement("div"),this.renderer.addClass(this.sentinel,"sentinel"),this.renderer.setStyle(this.sentinel,"height","0"),this.renderer.setStyle(this.sentinel,"overflow","hidden"),this.renderer.insertBefore(c.parentNode,this.sentinel,c);let l=this.stickyTop;requestAnimationFrame(()=>{this.ngZone.runOutsideAngular(()=>{this.observer=new IntersectionObserver(s=>{if(this.skipInitialObserverCallback){this.skipInitialObserverCallback=!1;return}let m=s[0];m.isIntersecting?this.removeStickyClone():m.boundingClientRect.top<(m.rootBounds?.top??0)&&this.showStickyClone(c,a)},{threshold:0,rootMargin:`-${l+1}px 0px 0px 0px`}),this.observer.observe(this.sentinel)})}),this.ngZone.runOutsideAngular(()=>{this.tableResizeObserver=new ResizeObserver(()=>{this.stickyClone&&this.syncCloneToTable(c,a)}),this.tableResizeObserver.observe(c)})}ngOnDestroy(){this.observer?.disconnect(),this.observer=null,this.tableResizeObserver?.disconnect(),this.tableResizeObserver=null,this.skipInitialObserverCallback=!0,this.removeStickyClone(),this.removeSentinel()}showStickyClone(c,a){let l=c.getBoundingClientRect();if(l.width===0||l.height===0)return;this.removeStickyClone();let s=document.createElement("div");s.className="sticky-header-clone",s.style.top=this.stickyTop+"px";let m=document.createElement("table");m.className=c.className,m.style.width="100%",m.style.tableLayout="fixed";let h=a.cloneNode(!0);m.appendChild(h),s.appendChild(m),document.body.appendChild(s),this.stickyClone=s;let _=a.querySelectorAll("th"),w=h.querySelectorAll("th");_.forEach((A,I)=>{w[I]&&(A.hasAttribute("mat-sort-header")||A.querySelector("a")||A.hasAttribute("(click)"))&&(w[I].style.cursor="pointer",w[I].addEventListener("click",()=>{A.click()}))}),this.syncCloneToTable(c,a)}syncCloneToTable(c,a){if(!this.stickyClone)return;let l=c.getBoundingClientRect();if(l.width===0||l.height===0)return;this.stickyClone.style.left=l.left+"px",this.stickyClone.style.width=l.width+"px";let s=this.stickyClone.querySelector("thead");if(!s)return;let m=a.querySelectorAll("th"),h=s.querySelectorAll("th");m.forEach((_,w)=>{if(h[w]){let A=_.offsetWidth;h[w].style.width=A+"px",h[w].style.minWidth=A+"px",h[w].style.maxWidth=A+"px"}})}removeStickyClone(){this.stickyClone&&(this.stickyClone.remove(),this.stickyClone=null)}removeSentinel(){this.sentinel&&(this.sentinel.remove(),this.sentinel=null)}static \u0275fac=function(a){return new(a||o)(se(oc),se(w2),se(rv))};static \u0275dir=A2({type:o,selectors:[["","appStickyHeader",""]],inputs:{stickyTop:"stickyTop",stickyEnabled:"stickyEnabled"},exportAs:["appStickyHeader"]})};function P7(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td",9),v(4),F(5,"number"),p(),d(6,"td",9),v(7),F(8,"number"),p(),d(9,"td",9),v(10),F(11,"number"),p(),d(12,"td",9),v(13),F(14,"number"),p()()),o&2){let a=c.$implicit;f(2),Ae(a.outlet),f(2),Ae(Ie(5,5,a.available,"1.0-3")),f(3),Ae(Ie(8,8,a.sales,"1.0-3")),f(3),oe(" ",Ie(11,11,a==null?null:a.QtyPerDay,"1.0-4")," "),f(3),oe(" ",Ie(14,14,a.daysToZero,"1.0-0")," ")}}var Tp=class o{constructor(c,a){this.httpService=c;this.dialog=a}httpService;dialog;variantInfoModel=Ci();listData$=a0([]);originalData$=a0([]);lastDays=Qe(30);totals=Qe({available:0,sales:0,qtyPerDay:0,daysToZero:0});ngOnChanges(c){c.variantInfoModel&&(this.lastDays.set(this.variantInfoModel()?.Config.ToZeroDays),this.initListData())}initListData(){let c=this.variantInfoModel()?.Data.Variant,a=this.variantInfoModel()?.Data.EntityStockOutlet||[],l;this.listData$=this.getForecastData(c.ID,this.lastDays()).pipe(u1(s=>s.Data),u1(s=>{let m=a.filter(w=>s.findIndex(A=>A.EntityID==w.EntityID)!=-1).map(w=>{let A=s.find(P=>w.EntityID==P.EntityID),I=A?.Quantity?A?.Quantity/this.lastDays():0;return{outlet:w.Name,available:w.Available,sales:A?.Quantity?A?.Quantity:0,QtyPerDay:I,daysToZero:w.Available>0&&I>0?w.Available/I:0}}),h=m.reduce((w,A)=>w+A.available,0),_=m.reduce((w,A)=>w+A.QtyPerDay,0);return this.totals.set({available:h,sales:m.reduce((w,A)=>w+A.sales,0),qtyPerDay:_,daysToZero:h>0&&_>0?h/_:0}),m}),xo(1)),this.originalData$=this.listData$}onUpdateLastDays(){this.dialog.open(Mp,{data:this.lastDays()}).afterClosed().pipe(ql(c=>Qi.IsNotEmpty(c))).subscribe(c=>{this.lastDays.set(c),this.initListData()})}getForecastData(c,a){let l={VariantID:c,NumberOfDays:a};return this.httpService.post("/api/catalog/variant/ProductsSoldGroupByOutlet",l).pipe(xo(1))}onSort(c){if(!c.active||c.direction===""){this.listData$=this.originalData$;return}this.listData$=this.listData$.pipe(u1(a=>(a=a.sort((l,s)=>{let m=c.direction==="asc";return Qi.compare(l[c.active],s[c.active],m)}),a)))}static \u0275fac=function(a){return new(a||o)(se(ki),se(Ma))};static \u0275cmp=nt({type:o,selectors:[["app-info-variant-mav-forecast"]],inputs:{variantInfoModel:[1,"variantInfoModel"]},standalone:!1,features:[Wr],decls:42,vars:25,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"content"],["appStickyHeader","","matSort","",1,"table","custom-table","mt-5",3,"matSortChange","stickyTop"],[1,"thead-light"],[1,"table-secondary"],[2,"width","200px"],["matTooltipPosition","above","matTooltip","Inventory available for sale",1,"text-end"],[1,"text-end"],["matTooltipPosition","above",1,"pointer",3,"click","matTooltip"],["arrowPosition","before","mat-sort-header","QtyPerDay","matTooltipPosition","above","matTooltip","Quantity sold per Day",1,"text-end"],["mat-sort-header","daysToZero","arrowPosition","before","matTooltipPosition","above","matTooltip","How many days left until you run out of inventory",1,"text-end"],[1,"fw-bold"]],template:function(a,l){if(a&1&&(Us(0),F(1,"async"),d(2,"div",0)(3,"div",1)(4,"div",2)(5,"div",3)(6,"table",4),de("matSortChange",function(m){return l.onSort(m)}),d(7,"thead",5)(8,"tr",6)(9,"th",7),v(10,"Outlet"),p(),d(11,"th",8),v(12," Available "),p(),d(13,"th",9)(14,"a",10),F(15,"number"),de("click",function(){return l.onUpdateLastDays()}),v(16),F(17,"number"),p()(),d(18,"th",11),v(19," Qty / Day "),p(),d(20,"th",12),v(21," Days of "),p()()(),d(22,"tbody"),Jt(23,P7,15,17,"tr",null,vi),p(),d(25,"tfoot")(26,"tr",13)(27,"td"),v(28,"Total"),p(),d(29,"td",9),v(30),F(31,"number"),p(),d(32,"td",9),v(33),F(34,"number"),p(),d(35,"td",9),v(36),F(37,"number"),p(),d(38,"td",9),v(39),F(40,"number"),p()()()()()()()(),G(41,"POS-scroll-top")),a&2){let s=Ce(1,7,l.listData$);f(6),M("stickyTop",60),f(8),M("matTooltip","Quantity sold in the last "+Ce(15,9,l.lastDays())+" Day(s)"),f(2),oe(" (",Ce(17,11,l.lastDays())," Days Sales) "),f(7),Kt(s),f(7),oe(" ",Ie(31,13,l.totals().available,"1.0-3")," "),f(3),oe(" ",Ie(34,16,l.totals().sales,"1.0-3")," "),f(3),oe(" ",Ie(37,19,l.totals().qtyPerDay,"1.0-4")," "),f(3),oe(" ",Ie(40,22,l.totals().daysToZero,"1.0-0")," ")}},dependencies:[Ei,S1,I1,Ep,Yv,w1,Li],styles:['@charset "UTF-8";'],changeDetection:0})};var Pp=class o{variantInfoModel=Ci();inventoryType=g1;variant=Qe(void 0);categoryMeasurement=Qe(void 0);constructor(){}ngOnChanges(){this.variantInfoModel()&&(this.variant.set(this.variantInfoModel()?.Data.Variant),this.categoryMeasurement.set(this.variantInfoModel()?.Data.CategoryMeasurement))}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-advanced"]],inputs:{variantInfoModel:[1,"variantInfoModel"]},standalone:!1,features:[Wr],decls:32,vars:8,consts:[[1,"container-fluid","mt-6"],[1,"row","g-6"],[1,"col-4","mt-4"],[1,"text-muted","mb-1","d-block"],[1,"input-group"],["type","text","readonly","",1,"form-control","custom",3,"value"],[1,"col-sm-4","mt-4"],["for","measurement"],["type","text","id","measurement","placeholder","Measurements","name","Measurements","readonly","",1,"custom","form-control",3,"ngModel"],["for","sellPrice"],["type","text","id","sellPrice","placeholder","Sell Price Type","name","Sell Price Type","readonly","","matTooltipPosition","above",1,"custom","form-control",3,"ngModel","matTooltip"],["for","unitQty"],["type","text","id","unitQty","placeholder","Content","name","Content","readonly","",1,"custom","form-control",3,"ngModel"],["for","index"],["type","text","id","index","placeholder","Index","name","Index","readonly","",1,"custom","form-control",3,"ngModel"],["for","volume"],["type","text","id","volume","placeholder","Volume","name","Volume","readonly","",1,"custom","form-control",3,"ngModel"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),v(4,"UOM"),p(),d(5,"div",4),G(6,"input",5),p()(),d(7,"div",2)(8,"label",3),v(9,"Sub UOM"),p(),d(10,"div",4),G(11,"input",5),p()(),d(12,"div",6)(13,"label",7),v(14,"Measurements"),p(),G(15,"input",8),p(),d(16,"div",6)(17,"label",9),v(18,"Sell Price Type"),p(),G(19,"input",10),p(),d(20,"div",6)(21,"label",11),v(22,"Content"),p(),G(23,"input",12),p(),d(24,"div",6)(25,"label",13),v(26,"Index"),p(),G(27,"input",14),p(),d(28,"div",6)(29,"label",15),v(30,"Volume"),p(),G(31,"input",16),p()()()),a&2){let s,m,h,_,w,A,I,P;f(6),M("value",(s=l.variantInfoModel())==null||s.Data.UOM==null?null:s.Data.UOM.Name),f(5),M("value",(m=l.categoryMeasurement())==null?null:m.UOMQ),f(4),M("ngModel",(h=l.categoryMeasurement())==null?null:h.Measurement),f(4),M("ngModel",(_=l.variant())==null?null:_.SellPriceTypeString)("matTooltip",(w=l.variant())==null?null:w.SellPriceTypeString),f(4),M("ngModel",(A=l.variant())==null?null:A.UnitQuantity),f(4),M("ngModel",(I=l.variant())==null?null:I.ProductIndex),f(4),M("ngModel",(P=l.variant())==null?null:P.Volume)}},dependencies:[Ei,Cn,Vi,Ri],styles:["p-select .p-select-label{padding:10px 12px;border-radius:4px}",".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};function F7(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),d(3,"td",11)(4,"span"),v(5),F(6,"number"),p()()()),o&2){let a=c.$implicit;f(2),Ae(a.Name),f(3),oe(" ",Ce(6,2,a.Amount)," ")}}function V7(o,c){if(o&1&&(d(0,"div",6)(1,"table",7)(2,"thead")(3,"tr",8)(4,"th",9),v(5,"Name"),p(),d(6,"th",10),v(7," Commission "),p()()(),d(8,"tbody"),Jt(9,F7,7,4,"tr",null,vi),p()()()),o&2){let a=x(2);f(9),Kt(a.commisions())}}function R7(o,c){if(o&1&&(d(0,"div",0)(1,"div",2)(2,"div",3)(3,"label",4),v(4,"Commission"),p(),G(5,"input",5),F(6,"number"),p()(),d(7,"div",2),k(8,V7,11,0,"div",6),p()()),o&2){let a,l,s=x();f(5),M("ngModel",Ce(6,2,(a=s.variant())==null?null:a.SalesCommission)),f(3),D(((l=s.commisions())==null?null:l.length)!==0?8:-1)}}function O7(o,c){o&1&&G(0,"unauthorized-ui",1)}var Bp=class o{constructor(c){this.roleService=c}roleService;variantInfoModel=Ci();role=Ci(!1);commisions=Qe([]);variant=Qe(void 0);ngOnChanges(){this.variantInfoModel()&&(this.commisions.set(this.variantInfoModel()?.Data.Commission||[]),this.variant.set(this.variantInfoModel()?.Data.Variant))}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-commision"]],inputs:{variantInfoModel:[1,"variantInfoModel"],role:[1,"role"]},standalone:!1,features:[Wr],decls:2,vars:1,consts:[[1,"container-fluid","mt-6"],["role","Commission View"],[1,"row"],[1,"col-sm-4"],["for","commision"],["type","text","id","commision","placeholder","Commission","name","Commission","readonly","",1,"form-control","custom",3,"ngModel"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","120px"],[1,"text-end"]],template:function(a,l){a&1&&k(0,R7,9,4,"div",0)(1,O7,1,0,"unauthorized-ui",1),a&2&&D(l.role()?0:1)},dependencies:[Cn,Vi,Ri,kc,Li],styles:[".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var Q7=()=>["/menu/Products/Catalog/Variants/Info"],j7=o=>({ID:o});function L7(o,c){o&1&&(d(0,"th",8),v(1," Unit Cost "),p())}function H7(o,c){o&1&&(d(0,"th",8),v(1," Total Cost "),p())}function q7(o,c){o&1&&G(0,"i",13)}function G7(o,c){if(o&1&&(d(0,"td",10),v(1),F(2,"number"),p()),o&2){let a=x().$implicit,l=x();f(),oe(" ",l.findCurrencySymbolById(a==null?null:a.PriceCurrencyID)+" "+Ce(2,1,a==null?null:a.UnitCost)," ")}}function z7(o,c){if(o&1&&(d(0,"td",10),v(1),F(2,"number"),p()),o&2){let a=x().$implicit,l=x();f(),oe(" ",l.findCurrencySymbolById(a==null?null:a.PriceCurrencyID)+" "+Ce(2,1,a==null?null:a.TotalCost)," ")}}function Y7(o,c){if(o&1&&(d(0,"tr")(1,"td")(2,"div",11)(3,"a",12),v(4),p(),k(5,q7,1,0,"i",13),p()(),d(6,"td"),v(7),p(),d(8,"td"),v(9),p(),d(10,"td"),v(11),F(12,"number"),p(),d(13,"td"),v(14),p(),k(15,G7,3,3,"td",10),k(16,z7,3,3,"td",10),p()),o&2){let a=c.$implicit,l=x();f(3),M("routerLink",ft(12,Q7))("queryParams",ot(13,j7,a.ID)),f(),Ae(a==null?null:a.Name),f(),D(a!=null&&a.HasComponent?5:-1),f(2),Ae(a==null?null:a.Code),f(2),Ae(a==null?null:a.Quantity),f(2),Ae(Ce(12,10,a==null?null:a.OnHand)),f(3),Ae(a==null?null:a.UomName),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost?15:-1),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost?16:-1)}}function W7(o,c){o&1&&(d(0,"td",9),v(1,"Total :"),p())}function J7(o,c){if(o&1&&(d(0,"td",10),v(1),F(2,"sum"),F(3,"number"),p()),o&2){let a,l=x();f(),oe(" ",l.findCurrencySymbolById((a=l.composites()[0])==null?null:a.PriceCurrencyID)+" "+Ce(3,4,Ie(2,1,l.composites(),"TotalCost"))," ")}}var Np=class o{constructor(c){this.roleService=c}roleService;composites=Ci();role=Ci();currencies=Ci();findCurrencySymbolById(c){let a;return this.currencies()?.forEach(l=>{l.ID===c&&(a=l.Symbol)}),a}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-component"]],inputs:{composites:[1,"composites"],role:[1,"role"],currencies:[1,"currencies"]},standalone:!1,decls:25,vars:4,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","120px"],[1,"border-end",2,"width","70px"],[1,"border-end","number","cost","text-end",2,"width","120px"],["colspan","6",1,"text-end","fw-bold"],[1,"text-end"],[1,"d-flex","justify-content-between"],["target","_blank",3,"routerLink","queryParams"],["matTooltipPosition","above","matTooltip","This component has a component",1,"fa-solid","fa-code-branch"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"table",3)(4,"thead")(5,"tr",4)(6,"th",5),v(7,"Variant"),p(),d(8,"th",6),v(9,"Code"),p(),d(10,"th",7),v(11,"Qty"),p(),d(12,"th",7),v(13,"On Hand"),p(),d(14,"th",7),v(15,"Uom"),p(),k(16,L7,2,0,"th",8),k(17,H7,2,0,"th",8),p()(),d(18,"tbody"),Jt(19,Y7,17,15,"tr",null,vi),p(),d(21,"tfoot")(22,"tr"),k(23,W7,2,0,"td",9),k(24,J7,4,6,"td",10),p()()()()()()),a&2&&(f(16),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost?16:-1),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost?17:-1),f(2),Kt(l.composites()),f(4),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost?23:-1),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost?24:-1))},dependencies:[Ei,li,Li,el],encapsulation:2,changeDetection:0})};var t4=()=>["/menu/Fulfillment/Allocated/Unfulfilled_Products"],X7=o=>({VariantID:o}),$7=o=>({"expanded-icon":o}),Z7=(o,c)=>({VariantID:o,OutletID:c}),e9=o=>({ID:o});function t9(o,c){o&1&&(d(0,"span"),v(1,"Direct"),p())}function i9(o,c){o&1&&(d(0,"th",10),v(1," Indirect Allocated "),p())}function n9(o,c){if(o&1&&(d(0,"tr")(1,"td",25)(2,"a",26),v(3),p(),d(4,"small",27),v(5),p()(),d(6,"td",13),v(7),p(),d(8,"td",13),v(9),p(),d(10,"td",13),v(11),p()()),o&2){let a=c.$implicit;f(2),M("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",ot(7,e9,a.ID)),f(),oe(" ",a.VariantName," "),f(2),oe(" ",a.VariantCode," "),f(2),oe(" ",a.Quantity," "),f(2),oe(" ",a.OnHand," "),f(2),oe(" ",a.Allocated," ")}}function a9(o,c){if(o&1&&(d(0,"table",19)(1,"thead",21)(2,"tr",22)(3,"th",23),v(4,"Components"),p(),d(5,"th",24),v(6," Quantity "),p(),d(7,"th",24),v(8," On Hand "),p(),d(9,"th",24),v(10," Allocated "),p()()(),d(11,"tbody"),Jt(12,n9,12,9,"tr",null,J1),p()()),o&2){let a=x().$implicit;f(12),Kt(a.Components)}}function r9(o,c){if(o&1&&(d(0,"td",13),v(1),p()),o&2){let a=x().$implicit;f(),oe(" ",a.IndirectAllocated," ")}}function o9(o,c){if(o&1){let a=Se();d(0,"tr")(1,"td")(2,"div",16)(3,"button",17),de("click",function(){let s=U(a).$implicit,m=x();return Q(m.onExpand(s))}),G(4,"i",18),p(),d(5,"span"),v(6),p()(),k(7,a9,14,0,"table",19),p(),d(8,"td",13),v(9),p(),d(10,"td",20)(11,"a",15),v(12),F(13,"number"),p()(),k(14,r9,2,1,"td",13),d(15,"td",13),v(16),p()()}if(o&2){let a=c.$implicit,l=x();f(4),M("ngClass",ot(11,$7,l.displayExpandedRow(a.EntityID))),f(2),Ae(a.Outlet),f(),D(l.displayExpandedRow(a.EntityID)?7:-1),f(2),Ae(a.OnHand),f(2),M("routerLink",ft(13,t4))("queryParams",Ko(14,Z7,l.variantID,a.OutletID)),f(),oe(" ",Ce(13,9,a.Allocated)),f(2),D(l.TotalIndirect()>0?14:-1),f(2),Ae(a.Available)}}function l9(o,c){if(o&1&&(d(0,"td",13),v(1),F(2,"number"),p()),o&2){let a=x();f(),oe(" ",Ce(2,1,a.totalCompositeInventory().IndirectAllocated)," ")}}var Fp=class o{httpService=dn(ki);compositeInventories=y1([]);variantID=Ci("");totalCompositeInventory=Ci({Allocated:0,Available:0,OnHand:0,IndirectAllocated:0});compositeSortDirec=Qe(!1);TotalIndirect=Qe(0);expandedRow=Qe([]);ngOnInit(){for(let c of this.compositeInventories())this.TotalIndirect.update(a=>a+c.IndirectAllocated)}refreshAllocated(){this.httpService.post("/api/catalog/variant/refreshAllocated",{ID:this.variantID}).subscribe(c=>{this.calculateAllocated(c)})}calculateAllocated(c=[]){this.compositeInventories.set(this.compositeInventories().map(a=>{let l=c.find(s=>s.EntityID==a.OutletID)?.Allocated;return a.Allocated=Qi.IsNotEmpty(l)?0:a.Allocated,a}))}onExpand(c){c?.EntityID&&this.expandedRow.update(a=>a.includes(c.EntityID)?a.filter(l=>l!==c.EntityID):[...a,c.EntityID])}displayExpandedRow(c){return this.expandedRow().includes(c)}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-composite-inventory"]],inputs:{compositeInventories:[1,"compositeInventories"],variantID:[1,"variantID"],totalCompositeInventory:[1,"totalCompositeInventory"]},outputs:{compositeInventories:"compositeInventoriesChange"},standalone:!1,decls:38,vars:21,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-end"],["matTooltipPosition","above","matTooltip","Shows the maximum composite products that can be sold. E.g., if Package A needs 2 burgers and 1 french fries, with 10 burgers and 5 french fries in stock, only 5 packages can be sold",1,"border-end","text-end",2,"width","130px"],[1,"pointer"],[1,"fa-solid","fa-sort"],["matTooltipPosition","above","matTooltip","Allocated that associate directly with the product",1,"border-end","pointer","text-end",2,"width","100px"],["matTooltip","Allocated that associate indirectly with the product (either its parent, or its component)","matTooltipPosition","above",1,"border-end","text-end","pointer",2,"width","100px"],[1,"border-end","text-end",2,"width","100px"],["colspan","1"],[1,"text-end"],["matTooltipPosition","above","matTooltip","Refresh the calculated allocated inventory",1,"fa-solid","fa-refresh","me-2","cursor",3,"click"],["target","_blank",3,"routerLink","queryParams"],[1,"d-flex","gap-2","align-items-center"],[1,"btn","btn-sm","expand-btn",3,"click"],[1,"fa","fa-chevron-down",3,"ngClass"],[1,"table","border-bottom","mt-2",2,"width","100%"],[1,"text-end","border-bottom"],[2,"background-color","#f5f5f5"],[1,"text-muted"],[2,"width","55%","color","#3b3b3b"],[2,"text-align","right !important","color","#3b3b3b"],[1,"d-flex","flex-column"],[3,"routerLink","queryParams"],[2,"line-height","1"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"table",3)(4,"thead")(5,"tr",4)(6,"th",5),v(7,"Outlet"),p(),d(8,"th",6),v(9," Calculated "),d(10,"span",7),G(11,"i",8),p()(),d(12,"th",9),k(13,t9,2,0,"span"),v(14," Allocated "),p(),k(15,i9,2,0,"th",10),d(16,"th",11),v(17,"Available"),p()()(),d(18,"tbody"),Jt(19,o9,17,17,"tr",null,vi),F(21,"sortBy"),p(),d(22,"tfoot")(23,"tr"),G(24,"td",12),d(25,"td",13),v(26),F(27,"number"),p(),d(28,"td",13)(29,"i",14),de("click",function(){return l.refreshAllocated()}),p(),d(30,"span")(31,"a",15),v(32),F(33,"number"),p()()(),k(34,l9,3,3,"td",13),d(35,"td",13),v(36),F(37,"number"),p()()()()()()()),a&2&&(f(13),D(l.TotalIndirect()>0?13:-1),f(2),D(l.TotalIndirect()>0?15:-1),f(4),Kt(S2(21,8,l.compositeInventories(),"desc","OnHand")),f(7),oe(" ",Ce(27,12,l.totalCompositeInventory().OnHand)," "),f(5),M("routerLink",ft(18,t4))("queryParams",ot(19,X7,l.variantID)),f(),oe(" ",Ce(33,14,l.totalCompositeInventory().Allocated)," "),f(2),D(l.TotalIndirect()>0?34:-1),f(2),oe(" ",Ce(37,16,l.totalCompositeInventory().Available)," "))},dependencies:[Ei,Jr,li,Li,jv],styles:[".expand-btn[_ngcontent-%COMP%]{border-radius:100px;width:30px;height:30px;transition:all .3s ease;padding:0}.expand-btn[_ngcontent-%COMP%]:hover{background-color:#eaeaea}.expand-btn[_ngcontent-%COMP%]:focus{border:none;outline:none}.expanded-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}"],changeDetection:0})};var c9=o=>({ID:o});function d9(o,c){if(o&1&&(d(0,"tr")(1,"td")(2,"a",8),v(3),p()(),d(4,"td"),v(5),p(),d(6,"td",9),v(7),F(8,"number"),p()()),o&2){let a=c.$implicit;f(2),M("queryParams",ot(6,c9,a.ID)),f(),oe(" ",a.Name," "),f(2),Ae(a.Code),f(2),Ae(Ce(8,4,a.Quantity))}}var Vp=class o{dependencyOf=Ci();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-dependency-of"]],inputs:{dependencyOf:[1,"dependencyOf"]},standalone:!1,decls:15,vars:0,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","200px"],[1,"border-end","text-end",2,"width","80px"],["routerLink","/menu/Products/Catalog/Variants/Info",1,"link",2,"cursor","pointer",3,"queryParams"],[1,"text-end"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"table",3)(4,"thead")(5,"tr",4)(6,"th",5),v(7,"Name"),p(),d(8,"th",6),v(9,"Code"),p(),d(10,"th",7),v(11,"Quantity"),p()()(),d(12,"tbody"),Jt(13,d9,9,8,"tr",null,vi),p()()()()()),a&2&&(f(13),Kt(l.dependencyOf()))},dependencies:[li,Li],styles:["a[_ngcontent-%COMP%]{color:#0976b4;text-decoration:none;background-color:transparent}"],changeDetection:0})};var Rp=class o{variant=Ci();ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-description"]],inputs:{variant:[1,"variant"]},standalone:!1,decls:6,vars:1,consts:[[1,"container-fluid","mt-10"],[1,"row"],[1,"col-sm-12"],["for","desc"],[1,"form-control","custom",2,"height","max-content",3,"innerHTML"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),v(4,"Descriptions"),p(),G(5,"span",4),p()()()),a&2){let s;f(5),M("innerHTML",(s=l.variant())==null?null:s.Description,W1)}},styles:["span[_ngcontent-%COMP%]{color:#333;cursor:pointer;font-size:300px;background-color:#fff;opacity:1;height:3.625rem;padding:1rem .75rem!important;color:#343434;font-size:.875rem;border-radius:.25rem!important}label[_ngcontent-%COMP%]{top:-10px!important;background-color:#fff!important}",".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var i4=()=>["/menu/Fulfillment/Allocated/Unfulfilled_Products"],f9=o=>({VariantID:o}),u9=()=>["/menu/Products/Catalog/Variants/Log"],v9=(o,c)=>({ID:o,EntityID:c}),g9=(o,c)=>({VariantID:o,OutletID:c});function b9(o,c){o&1&&(d(0,"div",0)(1,"div",2)(2,"div",3)(3,"p"),v(4,"This variant type does not have an inventory"),p()()()())}function h9(o,c){o&1&&(d(0,"span"),v(1,"Direct"),p())}function x9(o,c){o&1&&(d(0,"th",9),v(1," Indirect Allocated "),p())}function _9(o,c){o&1&&(d(0,"th",11),v(1," ROP "),p())}function C9(o,c){o&1&&(d(0,"th",12),v(1," Max "),p())}function y9(o,c){if(o&1&&(d(0,"td",19),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.IndirectAllocated)," ")}}function w9(o,c){if(o&1&&(d(0,"td",20),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;M("ngClass",a.MinStock>=a.OnHand&&a.MinStock!=0?"bg-gradient-warning":""),f(),oe(" ",Ce(2,2,a.MinStock)," ")}}function A9(o,c){if(o&1&&(d(0,"td",21),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;M("ngClass",a.MaxStock>=a.OnHand&&a.MaxStock!=0?"bg-gradient-warning":""),f(),oe(" ",Ce(2,2,a.MaxStock)," ")}}function S9(o,c){if(o&1&&(d(0,"tr")(1,"td",16),v(2),p(),d(3,"td",17)(4,"a",18),v(5),F(6,"number"),p()(),d(7,"td",19)(8,"a",15),v(9),F(10,"number"),p()(),k(11,y9,3,3,"td",19),d(12,"td",19),v(13),F(14,"number"),p(),k(15,w9,3,4,"td",20),F(16,"sum"),k(17,A9,3,4,"td",21),F(18,"sum"),p()),o&2){let a=c.$implicit,l=x(2);f(2),oe(" ",a.EntityGroupName," "),f(),M("ngClass",a.MinStock>=a.OnHand&&a.MinStock!=0?"bg-gradient-warning":""),f(),M("routerLink",ft(24,u9))("queryParams",Ko(25,v9,l.variant().ID,a.EntityID)),f(),oe(" ",Ce(6,12,a.OnHand)),f(3),M("routerLink",ft(28,i4))("queryParams",Ko(29,g9,l.variant().ID,a.EntityID)),f(),oe(" ",Ce(10,14,a.Allocated)),f(2),D(l.totalAllocatedIndrection()>0?11:-1),f(2),oe(" ",Ce(14,16,a.Available)," "),f(2),D(Ie(16,18,l.entityStock(),"MinStock")!=0?15:-1),f(2),D(Ie(18,21,l.entityStock(),"MaxStock")!=0?17:-1)}}function I9(o,c){if(o&1&&(d(0,"td",14),v(1),F(2,"sum"),F(3,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(3,4,Ie(2,1,a.entityStock(),"IndirectAllocated"))," ")}}function k9(o,c){if(o&1&&(d(0,"td",14),v(1),F(2,"sum"),F(3,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(3,4,Ie(2,1,a.entityStock(),"Available"))," ")}}function D9(o,c){if(o&1&&(d(0,"td",14),v(1),F(2,"sum"),F(3,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(3,4,Ie(2,1,a.entityStock(),"MinStock"))," ")}}function M9(o,c){if(o&1&&(d(0,"td",14),v(1),F(2,"sum"),F(3,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(3,4,Ie(2,1,a.entityStock(),"MaxStock"))," ")}}function E9(o,c){if(o&1){let a=Se();d(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"table",5),de("matSortChange",function(s){U(a);let m=x();return Q(m.sortData(s))}),d(5,"thead",6)(6,"tr",7)(7,"th"),v(8,"Group"),p(),d(9,"th",8),v(10," On Hand "),p(),d(11,"th",9),k(12,h9,2,0,"span"),v(13," Allocated "),p(),k(14,x9,2,0,"th",9),d(15,"th",10),v(16," Available "),p(),k(17,_9,2,0,"th",11),F(18,"sum"),k(19,C9,2,0,"th",12),F(20,"sum"),p()(),d(21,"tbody"),Jt(22,S9,19,32,"tr",null,vi),p(),d(24,"tfoot")(25,"tr"),G(26,"td",13),d(27,"td",14),v(28),F(29,"sum"),F(30,"number"),p(),d(31,"td",14)(32,"a",15),v(33),F(34,"sum"),F(35,"number"),p()(),k(36,I9,4,6,"td",14),k(37,k9,4,6,"td",14),F(38,"sum"),k(39,D9,4,6,"td",14),F(40,"sum"),k(41,M9,4,6,"td",14),F(42,"sum"),p()()()()()()()}if(o&2){let a=x();f(12),D(a.totalAllocatedIndrection()>0?12:-1),f(2),D(a.totalAllocatedIndrection()>0?14:-1),f(3),D(Ie(18,12,a.entityStock(),"MinStock")!=0?17:-1),f(2),D(Ie(20,15,a.entityStock(),"MaxStock")!=0?19:-1),f(3),Kt(a.entityStock()),f(6),oe(" ",Ce(30,21,Ie(29,18,a.entityStock(),"OnHand"))," "),f(4),M("routerLink",ft(37,i4))("queryParams",ot(38,f9,a.variant().ID)),f(),oe(" ",Ce(35,26,Ie(34,23,a.entityStock(),"Allocated"))),f(3),D(a.totalAllocatedIndrection()>0?36:-1),f(),D(Ie(38,28,a.entityStock(),"Available")!==0?37:-1),f(2),D(Ie(40,31,a.entityStock(),"MinStock")!==0?39:-1),f(2),D(Ie(42,34,a.entityStock(),"MaxStock")!==0?41:-1)}}var Op=class o{constructor(c){this.roleService=c}roleService;variantInfoModel=Ci();variantType=g1;originalStock=Qe(null);variant=Qe(void 0);variantParent=Qe(void 0);entityStock=Qe([]);totalAllocatedIndrection=Qe(0);ngOnInit(){for(let c of this.entityStock())this.totalAllocatedIndrection.set(this.totalAllocatedIndrection()+c.IndirectAllocated)}ngOnChanges(){this.variantInfoModel()&&(this.variantParent.set(this.variantInfoModel()?.Data.VariantParent),this.variant.set(this.variantInfoModel()?.Data.Variant),this.entityStock.set(this.variantInfoModel()?.Data.EntityStockGroup),this.originalStock.set(this.entityStock()))}sortData(c){let a=this.entityStock().slice();if(!c.active||c.direction===""){this.entityStock.set(this.originalStock());return}this.entityStock.set(a.sort((l,s)=>{let m=c.direction==="asc";return this.compare(l[c.active],s[c.active],m)}))}compare(c,a,l){return(c<a?-1:1)*(l?1:-1)}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-group-inventory"]],inputs:{variantInfoModel:[1,"variantInfoModel"]},standalone:!1,features:[Wr],decls:2,vars:2,consts:[[1,"container-fluid","mt-10"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light"],[1,"table-secondary"],["mat-sort-header","OnHand","arrowPosition","before","matTooltipPosition","above","matTooltip","How many you have in your warehouse right now",1,"text-end","border-end",2,"width","100px",3,"sort"],["matTooltipPosition","above","matTooltip","How many have been Allocated, but not shipped out yet",1,"text-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","How many can be purchased by customers",1,"text-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","ROP Inventory for this outlet before it gets re-alerted",1,"text-end",2,"width","70px"],["matTooltipPosition","above","matTooltip","Max Inventory that this outlet should have",1,"text-end",2,"width","70px"],["colspan","1"],[1,"text-end","border-end"],["target","_blank",3,"routerLink","queryParams"],[2,"vertical-align","middle"],[1,"text-end","border-end",2,"vertical-align","middle",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end","border-bottom"],[1,"text-end",3,"ngClass"],[1,"text-end","bg-warning",3,"ngClass"]],template:function(a,l){if(a&1&&(k(0,b9,5,0,"div",0),k(1,E9,43,40,"div",1)),a&2){let s,m;D(l.variantParent()&&((s=l.variantParent())==null?null:s.Ratio)>0||((s=l.variant())==null?null:s.TypeID)==l.variantType.MultipleUOM||((s=l.variant())==null?null:s.TypeID)==l.variantType.Serialized||((s=l.variant())==null?null:s.TypeID)==l.variantType.Standard||((s=l.variant())==null?null:s.TypeID)==l.variantType.Complementary||((s=l.variant())==null?null:s.TypeID)==l.variantType.Manufactured||((s=l.variant())==null?null:s.TypeID)==l.variantType.BatchNumber?-1:0),f(),D(l.variantParent()&&((m=l.variantParent())==null?null:m.Ratio)>0||((m=l.variant())==null?null:m.TypeID)==l.variantType.MultipleUOM||((m=l.variant())==null?null:m.TypeID)==l.variantType.Serialized||((m=l.variant())==null?null:m.TypeID)==l.variantType.Standard||((m=l.variant())==null?null:m.TypeID)==l.variantType.Complementary||((m=l.variant())==null?null:m.TypeID)==l.variantType.Manufactured||((m=l.variant())==null?null:m.TypeID)==l.variantType.BatchNumber?1:-1)}},dependencies:[Ei,Jr,li,S1,I1,Li,el],encapsulation:2,changeDetection:0})};var n4=wx(Ax());var a4=()=>["/menu/Products/Catalog/Variants/Log"],P9=o=>({ID:o}),B9=(o,c)=>({ID:o,EntityID:c}),r4=()=>["/menu/Fulfillment/Allocated/Unfulfilled_Products"],N9=(o,c)=>({VariantID:o,OutletID:c}),F9=()=>["/menu/Fulfillment/Allocated/PickList_Products"],o4=o=>({VariantID:o}),V9=(o,c)=>({"bg-gradient-danger":o,"bg-gradient-warning":c}),R9=o=>({"bg-gradient-danger":o}),O9=o=>({"bg-gradient-warning":o});function U9(o,c){o&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"p"),v(4,"This variant type does not have an inventory"),p()()()())}function Q9(o,c){o&1&&(d(0,"div"),v(1,"Outlet"),p())}function j9(o,c){if(o&1&&(d(0,"a",27),v(1,"Log"),p()),o&2){let a,l=x(3);M("routerLink",ft(2,a4))("queryParams",ot(3,P9,(a=l.variant())==null?null:a.ID))}}function L9(o,c){if(o&1&&(d(0,"div",9),k(1,j9,2,5,"a",27),p()),o&2){let a,l=x(2);f(),D(l.variantParent()&&l.variantParent().Ratio>0||((a=l.variant())==null?null:a.TypeID)==l.variantType.MultipleUOM||((a=l.variant())==null?null:a.TypeID)==l.variantType.BaseUnit||((a=l.variant())==null?null:a.TypeID)==l.variantType.Serialized||((a=l.variant())==null?null:a.TypeID)==l.variantType.Standard||((a=l.variant())==null?null:a.TypeID)==l.variantType.Complementary||((a=l.variant())==null?null:a.TypeID)==l.variantType.Manufactured||((a=l.variant())==null?null:a.TypeID)==l.variantType.BatchNumber?1:-1)}}function H9(o,c){if(o&1){let a=Se();d(0,"input",28),je("ngModelChange",function(s){U(a);let m=x(2);return Oe(m.outletQuery,s)||(m.outletQuery=s),Q(s)}),de("click",function(s){return s.stopPropagation()}),p()}if(o&2){let a=x(2);Le("ngModel",a.outletQuery)}}function q9(o,c){o&1&&(d(0,"span"),v(1,"Direct"),p())}function G9(o,c){if(o&1&&(d(0,"th",15),k(1,q9,2,0,"span"),F(2,"filterByName"),F(3,"sum"),v(4," Allocated "),p()),o&2){let a=x(2);f(),D(Ie(3,4,Ie(2,1,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0?1:-1)}}function z9(o,c){o&1&&(d(0,"th",16),v(1," Indirect Allocated "),p())}function Y9(o,c){o&1&&(d(0,"th",17),v(1," Pick List "),p())}function W9(o,c){o&1&&(d(0,"th",18),v(1," Delegated "),p())}function J9(o,c){o&1&&(d(0,"th",19),v(1," Available "),p())}function K9(o,c){o&1&&(d(0,"th",20),v(1," ROP "),p())}function X9(o,c){o&1&&(d(0,"th",21),v(1," Max "),p())}function $9(o,c){o&1&&(d(0,"th",22),v(1," Lead Time "),p())}function Z9(o,c){o&1&&(d(0,"th",23)(1,"span",29),v(2," Modified "),p()())}function eS(o,c){if(o&1&&(d(0,"td",25)(1,"a",34)(2,"span",35),v(3),F(4,"number"),p()()()),o&2){let a,l=x().$implicit,s=x(2);f(),M("routerLink",ft(6,r4))("queryParams",Ko(7,N9,(a=s.variant())==null?null:a.ID,l.EntityID)),f(),M("matTooltip",l.Modified&&l.Modified.trim()!==""?s.moment(l.Modified).format("DD MMM YYYY HH:mm:ss"):""),f(),oe(" ",Ce(4,4,l.Allocated)," ")}}function tS(o,c){if(o&1&&(d(0,"td",25)(1,"span",35),F(2,"filterByName"),F(3,"sum"),v(4),F(5,"number"),p()()),o&2){let a=x().$implicit,l=x(2);f(),M("matTooltip",Ie(3,5,Ie(2,2,l.entityStock(),l.outletQuery()),"Allocated")==0&&a.Modified&&a.Modified.trim()!==""?l.moment(a.Modified).format("DD MMM YYYY HH:mm"):""),f(3),oe(" ",Ce(5,8,a.IndirectAllocated)," ")}}function iS(o,c){if(o&1&&(d(0,"td",25)(1,"a",34),v(2),F(3,"number"),p()()),o&2){let a,l=x().$implicit,s=x(2);f(),M("routerLink",ft(5,F9))("queryParams",ot(6,o4,(a=s.variant())==null?null:a.ID)),f(),oe(" ",Ce(3,3,l.PickPack)," ")}}function nS(o,c){if(o&1&&(d(0,"td",25),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.PickPackDelegated)," ")}}function aS(o,c){if(o&1&&(d(0,"td",32),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;M("ngClass",Ko(4,V9,a.AvailableAdjustPickPack<a.MinStock&&a.MinStock!=0,a.AvailableAdjustPickPack>a.MaxStock&&a.MaxStock!=0)),f(),oe(" ",Ce(2,2,a.AvailableAdjustPickPack)," ")}}function rS(o,c){if(o&1&&(d(0,"td",33),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;M("ngClass",ot(4,R9,a.AvailableAdjustPickPack<a.MinStock&&a.MinStock!=0)),f(),oe(" ",Ce(2,2,a.MinStock)," ")}}function oS(o,c){if(o&1&&(d(0,"td",33),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;M("ngClass",ot(4,O9,a.OnHand>a.MaxStock&&a.MaxStock!=0)),f(),oe(" ",Ce(2,2,a.MaxStock)," ")}}function lS(o,c){if(o&1&&(d(0,"td",25),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",Ce(2,1,a.LeadTime??0)," ")}}function sS(o,c){if(o&1&&(d(0,"td",23)(1,"span"),v(2),F(3,"date"),p()()),o&2){let a=x().$implicit;f(2),oe(" ",Ie(3,1,a.OnHandModified,"dd MMM yyyy HH:mm:ss")," ")}}function cS(o,c){if(o&1&&(d(0,"tr")(1,"td",30),v(2),p(),d(3,"td",25)(4,"a",31),v(5),F(6,"number"),p()(),k(7,eS,5,10,"td",25),F(8,"filterByName"),F(9,"sum"),F(10,"filterByName"),F(11,"sum"),k(12,tS,6,10,"td",25),F(13,"filterByName"),F(14,"sum"),k(15,iS,4,8,"td",25),F(16,"filterByName"),F(17,"sum"),k(18,nS,3,3,"td",25),F(19,"filterByName"),F(20,"sum"),k(21,aS,3,7,"td",32),F(22,"filterByName"),F(23,"sum"),F(24,"filterByName"),F(25,"sum"),F(26,"filterByName"),F(27,"sum"),F(28,"filterByName"),F(29,"sum"),F(30,"filterByName"),F(31,"sum"),k(32,rS,3,6,"td",33),F(33,"filterByName"),F(34,"sum"),k(35,oS,3,6,"td",33),F(36,"filterByName"),F(37,"sum"),k(38,lS,3,3,"td",25),k(39,sS,4,4,"td",23),p()),o&2){let a,l=c.$implicit,s=x(2);f(2),oe(" ",l.Name," "),f(2),M("routerLink",ft(87,a4))("queryParams",Ko(88,B9,(a=s.variant())==null?null:a.ID,l.EntityID)),f(),Ae(Ce(6,13,l.OnHand)),f(2),D(Ie(9,18,Ie(8,15,s.entityStock(),s.outletQuery()),"Allocated")!=0||Ie(11,24,Ie(10,21,s.entityStock(),s.outletQuery()),"IndirectAllocated")!=0?7:-1),f(5),D(Ie(14,30,Ie(13,27,s.entityStock(),s.outletQuery()),"IndirectAllocated")!=0?12:-1),f(3),D(Ie(17,36,Ie(16,33,s.entityStock(),s.outletQuery()),"PickPack")!=0?15:-1),f(3),D(Ie(20,42,Ie(19,39,s.entityStock(),s.outletQuery()),"PickPackDelegated")!=0?18:-1),f(3),D(Ie(23,48,Ie(22,45,s.entityStock(),s.outletQuery()),"AvailableAdjustPickPack")!=0&&(Ie(25,54,Ie(24,51,s.entityStock(),s.outletQuery()),"PickPackDelegated")!=0||Ie(27,60,Ie(26,57,s.entityStock(),s.outletQuery()),"PickPack")!=0||Ie(29,66,Ie(28,63,s.entityStock(),s.outletQuery()),"Allocated")!=0||Ie(31,72,Ie(30,69,s.entityStock(),s.outletQuery()),"IndirectAllocated")!=0)?21:-1),f(11),D(Ie(34,78,Ie(33,75,s.entityStock(),s.outletQuery()),"MinStock")!=0?32:-1),f(3),D(Ie(37,84,Ie(36,81,s.entityStock(),s.outletQuery()),"MaxStock")!=0?35:-1),f(3),D(s.isHasLeadTime()&&s.columns().LeadTime.selected?38:-1),f(),D(s.columns().Modified.selected?39:-1)}}function dS(o,c){if(o&1){let a=Se();d(0,"td",25)(1,"i",36),de("click",function(){U(a);let s=x(2);return Q(s.refreshAllocated())}),p(),d(2,"a",34),v(3),F(4,"filterByName"),F(5,"sum"),F(6,"number"),p()()}if(o&2){let a,l=x(2);f(2),M("routerLink",ft(11,r4))("queryParams",ot(12,o4,(a=l.variant())==null?null:a.ID)),f(),oe(" ",Ce(6,9,Ie(5,6,Ie(4,3,l.entityStock(),l.outletQuery()),"Allocated"))," ")}}function pS(o,c){if(o&1){let a=Se();d(0,"td",25)(1,"i",36),de("click",function(){U(a);let s=x(2);return Q(s.refreshAllocated())}),p(),d(2,"span"),v(3),F(4,"filterByName"),F(5,"sum"),F(6,"number"),p()()}if(o&2){let a=x(2);f(3),oe(" ",Ce(6,7,Ie(5,4,Ie(4,1,a.entityStock(),a.outletQuery()),"IndirectAllocated"))," ")}}function mS(o,c){if(o&1&&(d(0,"td",25),v(1),F(2,"filterByName"),F(3,"sum"),F(4,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(4,7,Ie(3,4,Ie(2,1,a.entityStock(),a.outletQuery()),"PickPack"))," ")}}function fS(o,c){if(o&1&&(d(0,"td",25),v(1),F(2,"filterByName"),F(3,"sum"),F(4,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(4,7,Ie(3,4,Ie(2,1,a.entityStock(),a.outletQuery()),"PickPackDelegated"))," ")}}function uS(o,c){if(o&1&&(d(0,"td",25),v(1),F(2,"filterByName"),F(3,"sum"),F(4,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(4,7,Ie(3,4,Ie(2,1,a.entityStock(),a.outletQuery()),"AvailableAdjustPickPack"))," ")}}function vS(o,c){if(o&1&&(d(0,"td",26),v(1),F(2,"filterByName"),F(3,"avg"),F(4,"ceil"),F(5,"number"),p()),o&2){let a=x(2);f(),oe(" ",Ce(5,9,Ce(4,7,Ie(3,4,Ie(2,1,a.entityStock(),a.outletQuery()),"LeadTime")))," ")}}function gS(o,c){if(o&1){let a=Se();d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4),de("matSortChange",function(s){U(a);let m=x();return Q(m.sortData(s))}),d(5,"thead",5)(6,"tr",6)(7,"th",7)(8,"div",8),k(9,Q9,2,0,"div"),k(10,L9,2,1,"div",9),k(11,H9,1,1,"input",10),d(12,"div",11)(13,"i",12),de("click",function(s){U(a);let m=x();return s.stopPropagation(),m.filterOutletToggle.set(!m.filterOutletToggle()),Q(m.outletQuery.set(""))}),p(),d(14,"pos-column-toggle",13),de("click",function(s){return s.stopPropagation()}),p()()()(),d(15,"th",14),F(16,"filterByName"),F(17,"sum"),F(18,"number"),v(19," On Hand "),p(),k(20,G9,5,7,"th",15),F(21,"filterByName"),F(22,"sum"),F(23,"filterByName"),F(24,"sum"),k(25,z9,2,0,"th",16),F(26,"filterByName"),F(27,"sum"),k(28,Y9,2,0,"th",17),F(29,"filterByName"),F(30,"sum"),k(31,W9,2,0,"th",18),F(32,"filterByName"),F(33,"sum"),k(34,J9,2,0,"th",19),F(35,"filterByName"),F(36,"sum"),F(37,"filterByName"),F(38,"sum"),F(39,"filterByName"),F(40,"sum"),F(41,"filterByName"),F(42,"sum"),F(43,"filterByName"),F(44,"sum"),k(45,K9,2,0,"th",20),F(46,"filterByName"),F(47,"sum"),k(48,X9,2,0,"th",21),F(49,"filterByName"),F(50,"sum"),k(51,$9,2,0,"th",22),k(52,Z9,3,0,"th",23),p()(),d(53,"tbody"),Jt(54,cS,40,91,"tr",null,vi),F(56,"filterByName"),p(),d(57,"tfoot")(58,"tr"),G(59,"td",24),d(60,"td",25),v(61),F(62,"filterByName"),F(63,"sum"),F(64,"number"),p(),k(65,dS,7,14,"td",25),F(66,"filterByName"),F(67,"sum"),F(68,"filterByName"),F(69,"sum"),k(70,pS,7,9,"td",25),F(71,"filterByName"),F(72,"sum"),k(73,mS,5,9,"td",25),F(74,"filterByName"),F(75,"sum"),k(76,fS,5,9,"td",25),F(77,"filterByName"),F(78,"sum"),k(79,uS,5,9,"td",25),F(80,"filterByName"),F(81,"sum"),F(82,"filterByName"),F(83,"sum"),F(84,"filterByName"),F(85,"sum"),F(86,"filterByName"),F(87,"sum"),F(88,"filterByName"),F(89,"sum"),k(90,vS,6,11,"td",26),p()()()()()()()}if(o&2){let a=x();f(9),D(a.filterOutletToggle()?-1:9),f(),D(a.roleService.inventory.View&&!a.roleService.users.LogRestriction&&!a.filterOutletToggle()?10:-1),f(),D(a.filterOutletToggle()?11:-1),f(2),hr("fa-filter",!a.filterOutletToggle())("fa-filter-slash",a.filterOutletToggle()),lv("title",a.filterOutletToggle()?"Click to hide search bar":"Click to search outlet"),f(),M("column",a.columns()),f(),M("matTooltip","Total of on hand inventory from all outlets ("+Ce(18,32,Ie(17,29,Ie(16,26,a.entityStock(),a.outletQuery()),"OnHand"))+")"),f(5),D(Ie(22,37,Ie(21,34,a.entityStock(),a.outletQuery()),"Allocated")!=0||Ie(24,43,Ie(23,40,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0?20:-1),f(5),D(Ie(27,49,Ie(26,46,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0?25:-1),f(3),D(Ie(30,55,Ie(29,52,a.entityStock(),a.outletQuery()),"PickPack")!=0?28:-1),f(3),D(Ie(33,61,Ie(32,58,a.entityStock(),a.outletQuery()),"PickPackDelegated")!=0?31:-1),f(3),D(Ie(36,67,Ie(35,64,a.entityStock(),a.outletQuery()),"AvailableAdjustPickPack")!=0&&(Ie(38,73,Ie(37,70,a.entityStock(),a.outletQuery()),"PickPackDelegated")!=0||Ie(40,79,Ie(39,76,a.entityStock(),a.outletQuery()),"PickPack")!=0||Ie(42,85,Ie(41,82,a.entityStock(),a.outletQuery()),"Allocated")!=0||Ie(44,91,Ie(43,88,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0)?34:-1),f(11),D(Ie(47,97,Ie(46,94,a.entityStock(),a.outletQuery()),"MinStock")!=0?45:-1),f(3),D(Ie(50,103,Ie(49,100,a.entityStock(),a.outletQuery()),"MaxStock")!=0?48:-1),f(3),D(a.isHasLeadTime()&&a.columns().LeadTime.selected?51:-1),f(),D(a.columns().Modified.selected?52:-1),f(2),Kt(Ie(56,106,a.entityStock(),a.outletQuery())),f(7),oe(" ",Ce(64,115,Ie(63,112,Ie(62,109,a.entityStock(),a.outletQuery()),"OnHand"))," "),f(4),D(Ie(67,120,Ie(66,117,a.entityStock(),a.outletQuery()),"Allocated")!=0||Ie(69,126,Ie(68,123,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0?65:-1),f(5),D(Ie(72,132,Ie(71,129,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0?70:-1),f(3),D(Ie(75,138,Ie(74,135,a.entityStock(),a.outletQuery()),"PickPack")!=0?73:-1),f(3),D(Ie(78,144,Ie(77,141,a.entityStock(),a.outletQuery()),"PickPackDelegated")!=0?76:-1),f(3),D(Ie(81,150,Ie(80,147,a.entityStock(),a.outletQuery()),"AvailableAdjustPickPack")!=0&&(Ie(83,156,Ie(82,153,a.entityStock(),a.outletQuery()),"PickPackDelegated")!=0||Ie(85,162,Ie(84,159,a.entityStock(),a.outletQuery()),"PickPack")!=0||Ie(87,168,Ie(86,165,a.entityStock(),a.outletQuery()),"Allocated")!=0)||Ie(89,174,Ie(88,171,a.entityStock(),a.outletQuery()),"IndirectAllocated")!=0?79:-1),f(11),D(a.isHasLeadTime()&&a.columns().LeadTime.selected?90:-1)}}var Up=class o{constructor(c){this.roleService=c}roleService;http=dn(ki);variantInfoModel=Ci();moment=n4.default;variantType=g1;filterOutletToggle=Qe(!1);outletQuery=Qe("");originalStock=Qe([]);variant=Qe(void 0);variantParent=Qe(void 0);entityStock=Qe([]);isHasLeadTime=H1(()=>this.entityStock()?.some(a=>(a.LeadTime??0)>0));columns=H1(()=>kr({Modified:{selected:!1,name:"Modified"}},this.isHasLeadTime()?{LeadTime:{selected:!1,name:"Lead Time"}}:{}));ngOnChanges(){this.variantInfoModel()&&(this.variantParent.set(this.variantInfoModel()?.Data.VariantParent),this.variant.set(this.variantInfoModel()?.Data.Variant),this.entityStock.set(this.variantInfoModel()?.Data.EntityStockOutlet||[]),this.originalStock.set(this.entityStock()))}sortData(c){let a=JSON.parse(JSON.stringify(this.originalStock()));if(!c.active||c.direction===""){this.entityStock.set(a);return}this.entityStock.set(a.sort((l,s)=>{let m=c.direction==="asc";return Qi.compare(l[c.active],s[c.active],m)}))}refreshAllocated(){this.http.post("/api/catalog/variant/refreshAllocated",{ID:this.variant()?.ID}).subscribe(c=>{c.forEach(a=>{this.entityStock.set(this.entityStock().map(l=>l.EntityID==a.EntityID?Fo(kr({},l),{Allocated:a.Allocated,Available:l.OnHand-a.Allocated-l.IndirectAllocated}):l))})})}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-inventory"]],inputs:{variantInfoModel:[1,"variantInfoModel"]},standalone:!1,features:[Wr],decls:2,vars:2,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light"],[1,"table-secondary"],["mat-sort-header","Name",1,"border-end","position-relative",2,"width","250px"],[1,"d-flex","justify-content-between","align-items-center"],[1,"btn-group","bg-white","ms-5"],["type","text","placeholder","Search Outlet by Name","aria-label","Search","autofocus","",1,"txtFilter","form-control",2,"width","175px",3,"ngModel"],[1,"position-absolute","end-0","d-flex","align-items-center","gap-2"],[1,"fa-solid",2,"margin-top","-2px",3,"click"],["cursor","pointer",3,"click","column"],["mat-sort-header","OnHand","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end","on-hand",2,"width","130px",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Inventory which is already reserved for customer's order",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Reserved because this product is a dependancy of other Product",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Pick List with status Picked / Assigned / Packed (Fulfillment for order which is received by another Outlet)",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Fulfillment that is delegated to another Outlet using Pick",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Do not sell above this to avoid OverSelling",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Variant safery stock",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Maximum Inventory you should have after PurchaseOrder or TransferOrder operation",1,"text-end","border-end",2,"width","100px"],[1,"text-end","border-end",2,"width","100px"],[1,"border-end"],["colspan","1"],[1,"text-end","border-end"],["colspan","2",1,"text-end","border-end"],[1,"btn","btn-outline-secondary","btn-sm",2,"font-size","10px !important",3,"routerLink","queryParams"],["type","text","placeholder","Search Outlet by Name","aria-label","Search","autofocus","",1,"txtFilter","form-control",2,"width","175px",3,"ngModelChange","click","ngModel"],["matTooltipPosition","above","matTooltip","When the OnHand Inventory is Last Modified (Inventory Log)"],[1,"border-end",2,"vertical-align","middle"],[3,"routerLink","queryParams"],[1,"text-end","border-bottom","border-end",2,"vertical-align","middle",3,"ngClass"],[1,"text-end","border-end",3,"ngClass"],["target","_blank",3,"routerLink","queryParams"],["matTooltipPosition","above",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Refresh the calculated allocated inventory",1,"fa-solid","fa-refresh","me-2","cursor",3,"click"]],template:function(a,l){if(a&1&&(k(0,U9,5,0,"div",0),k(1,gS,91,177,"div",0)),a&2){let s,m;D(l.variantParent()&&((s=l.variantParent())==null?null:s.Ratio)>0||((s=l.variant())==null?null:s.TypeID)==l.variantType.MultipleUOM||((s=l.variant())==null?null:s.TypeID)==l.variantType.BaseUnit||((s=l.variant())==null?null:s.TypeID)==l.variantType.Serialized||((s=l.variant())==null?null:s.TypeID)==l.variantType.Standard||((s=l.variant())==null?null:s.TypeID)==l.variantType.Complementary||((s=l.variant())==null?null:s.TypeID)==l.variantType.Manufactured||((s=l.variant())==null?null:s.TypeID)==l.variantType.BatchNumber?-1:0),f(),D(l.variantParent()&&((m=l.variantParent())==null?null:m.Ratio)>0||((m=l.variant())==null?null:m.TypeID)==l.variantType.MultipleUOM||((m=l.variant())==null?null:m.TypeID)==l.variantType.BaseUnit||((m=l.variant())==null?null:m.TypeID)==l.variantType.Serialized||((m=l.variant())==null?null:m.TypeID)==l.variantType.Standard||((m=l.variant())==null?null:m.TypeID)==l.variantType.Complementary||((m=l.variant())==null?null:m.TypeID)==l.variantType.Manufactured||((m=l.variant())==null?null:m.TypeID)==l.variantType.BatchNumber?1:-1)}},dependencies:[Ei,Jr,li,Cn,Vi,Ri,S1,I1,Z2,Li,Vn,el,Vv,Hv,sg],styles:['table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:has(.dropdown-menu.show){z-index:3}.table-overflow[_ngcontent-%COMP%]{height:600px;overflow:"auto"}.txtFilter[_ngcontent-%COMP%]{transition:all .3s ease;border:1px solid #ccc;border-radius:4px;padding:.5rem .75rem;font-size:.7rem;background-color:#fff;color:#333}.txtFilter[_ngcontent-%COMP%]::placeholder{color:#999}.txtFilter[_ngcontent-%COMP%]:hover{border-color:#89b03e;background-color:#f7fdf0}.txtFilter[_ngcontent-%COMP%]:focus{border-color:#89b03e;outline:none;box-shadow:0 0 0 .25rem #89b03e40;background-color:#fff}.txtFilter[_ngcontent-%COMP%]:not(:focus):not(:hover){background-color:#fff}pos-column-toggle[_ngcontent-%COMP%], pos-column-toggle h6{text-transform:none} .on-hand .mat-sort-header-content{flex-direction:column}'],changeDetection:0})};var l4=()=>["/menu/Products/Catalog/Variants/Info"],s4=o=>({ID:o});function hS(o,c){if(o&1&&(d(0,"div",1)(1,"div",3)(2,"h4",4),v(3," Unit Composition "),G(4,"i",5),p(),d(5,"div",6)(6,"div",7)(7,"h3"),v(8),p(),d(9,"h5",8),v(10),p()(),d(11,"div",9)(12,"h4",10),v(13,"="),p()(),d(14,"div",11)(15,"h3",12)(16,"a",13)(17,"span",14),v(18),p()()(),d(19,"h5",8),v(20),p()()()()()),o&2){let a,l,s,m,h,_,w=x();f(4),M("matTooltip","Unit Conversion: 1 "+((a=w.variantInfoModel())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.Model)+" = "+((a=w.baseUnit())==null?null:a.Ratio)+" PCs"),f(4),oe("1 ",(l=w.variantInfoModel())==null||l.Data==null||l.Data.Variant==null?null:l.Data.Variant.Name),f(2),oe(" ",!((s=w.variantInfoModel())==null||s.Data==null||s.Data.Variant==null)&&s.Data.Variant.Code?"("+((s=w.variantInfoModel())==null||s.Data==null||s.Data.Variant==null?null:s.Data.Variant.Code)+")":""," "),f(6),M("routerLink",ft(9,l4))("queryParams",ot(10,s4,(m=w.baseUnit())==null?null:m.BaseUnitID)),f(2),dv(" ",(h=w.baseUnit())==null?null:h.Ratio," ",(h=w.baseUnit())==null?null:h.ProductName," (",(h=w.baseUnit())==null?null:h.Model,") "),f(2),oe(" ",(_=w.baseUnit())!=null&&_.Code?"("+((_=w.baseUnit())==null?null:_.Code)+")":""," ")}}function xS(o,c){if(o&1&&(d(0,"div",2)(1,"div",3)(2,"h4",4),v(3," Used by Larger Unit "),G(4,"i",5),p(),d(5,"div",6)(6,"div",7)(7,"h3",12)(8,"a",13)(9,"span",14),v(10),p()()(),d(11,"h5",8),v(12),p()(),d(13,"div",9)(14,"h4",10),v(15,"="),p()(),d(16,"div",11)(17,"h3"),v(18),p(),d(19,"h5",8),v(20),p()()()()()),o&2){let a,l,s,m,h,_,w=x();f(4),M("matTooltip","Unit Conversion: 1 "+((a=w.parentUnit())==null?null:a.Model)+" = "+((a=w.parentUnit())==null?null:a.Ratio)+" "+((a=w.variantInfoModel())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.Model)),f(4),M("routerLink",ft(9,l4))("queryParams",ot(10,s4,(l=w.parentUnit())==null?null:l.ID)),f(2),so(" 1 ",(s=w.parentUnit())==null?null:s.ProductName," (",(s=w.parentUnit())==null?null:s.Model,") "),f(2),oe(" ",(m=w.parentUnit())!=null&&m.Code?"("+((m=w.parentUnit())==null?null:m.Code)+")":""," "),f(6),so(" ",(h=w.parentUnit())==null?null:h.Ratio," ",(h=w.variantInfoModel())==null||h.Data==null||h.Data.Variant==null?null:h.Data.Variant.Name," "),f(2),oe(" ",!((_=w.variantInfoModel())==null||_.Data==null||_.Data.Variant==null)&&_.Data.Variant.Code?"("+((_=w.variantInfoModel())==null||_.Data==null||_.Data.Variant==null?null:_.Data.Variant.Code)+")":""," ")}}var Qp=class o{variantInfoModel=Ci();variantType=Ci();inventoryType=g1;baseUnit=Qe(void 0);parentUnit=Qe(void 0);categoryMeasurement=Qe(void 0);constructor(){}ngOnChanges(){this.variantInfoModel()&&(this.baseUnit.set(this.variantInfoModel()?.Data.BaseUnit),this.parentUnit.set(this.variantInfoModel()?.Data.ParentUnit))}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-multi-unit"]],inputs:{variantInfoModel:[1,"variantInfoModel"],variantType:[1,"variantType"]},standalone:!1,features:[Wr],decls:3,vars:2,consts:[[1,"container-fluid","mt-10"],[1,"row"],[1,"row","mt-10"],[1,"col-12"],[1,"fw-normal","mb-4"],["matTooltipPosition","above",1,"fa-solid","fa-circle-info","text-secondary",2,"font-size","12px",3,"matTooltip"],[1,"d-flex","justify-content-between","align-items-center","mb-4"],[1,"p-6","rounded","d-flex","border","align-items-center","gap-3",2,"width","48%"],[1,"fw-normal"],[1,"d-flex","justify-content-center","align-items-center",2,"width","2%"],[1,"fw-bold"],[1,"p-6","rounded","d-flex","border","align-items-center","gap-3",2,"background-color","#f7f7f7","width","48%"],[1,"mb-0"],[1,"text-decoration-none",3,"routerLink","queryParams"],[1,"text-primary"]],template:function(a,l){a&1&&(d(0,"div",0),k(1,hS,21,12,"div",1),k(2,xS,21,12,"div",2),p()),a&2&&(f(),D(l.variantType()!==l.inventoryType.BaseUnit?1:-1),f(),D(l.parentUnit()||l.variantType()===l.inventoryType.BaseUnit?2:-1))},dependencies:[Ei,li],encapsulation:2,changeDetection:0})};function CS(o,c){o&1&&(d(0,"th",7),v(1,"Extra Cost"),p())}function yS(o,c){if(o&1&&(d(0,"td"),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",(a==null?null:a.PriceCurrency)+" "+Ce(2,1,a.ExtraCost)," ")}}function wS(o,c){if(o&1&&(d(0,"tr")(1,"td"),v(2),p(),k(3,yS,3,3,"td"),d(4,"td"),v(5),F(6,"number"),p(),d(7,"td"),v(8),p()()),o&2){let a=c.$implicit,l=x();f(2),Ae(a==null?null:a.EntityName),f(),D(l.hasProductCost()&&(l.roleService!=null&&l.roleService.product.Cost)?3:-1),f(2),oe(" ",(a==null?null:a.PriceCurrency)+" "+Ce(6,4,a.UnitPrice)," "),f(3),Ae(a.PriceDiscount+"%")}}var jp=class o{constructor(c){this.roleService=c}roleService;variantInfoModel=Ci();outletPrices=y1();currencies=y1();hasProductCost=y1();ngOnChanges(){this.variantInfoModel()&&(this.outletPrices.set(this.variantInfoModel()?.Data.OutletPrice),this.currencies.set(this.variantInfoModel()?.Data.Currencies),this.hasProductCost.set(this.roleService?.product?.Cost))}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-outlet-price"]],inputs:{variantInfoModel:[1,"variantInfoModel"],outletPrices:[1,"outletPrices"],currencies:[1,"currencies"],hasProductCost:[1,"hasProductCost"]},outputs:{outletPrices:"outletPricesChange",currencies:"currenciesChange",hasProductCost:"hasProductCostChange"},standalone:!1,features:[Wr],decls:17,vars:1,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],["width","100px",1,"border-end"],["width","50px",1,"border-end"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),v(8,"Outlet"),p(),k(9,CS,2,0,"th",7),d(10,"th",7),v(11,"Price"),p(),d(12,"th",8),v(13,"Disc."),p()()(),d(14,"tbody"),Jt(15,wS,9,6,"tr",null,vi),p()()()()()()),a&2&&(f(9),D(l.hasProductCost()&&(l.roleService!=null&&l.roleService.product.Cost)?9:-1),f(6),Kt(l.outletPrices()))},dependencies:[Li],encapsulation:2,changeDetection:0})};var SS=o=>({ID:o});function IS(o,c){if(o&1&&(d(0,"div",11),v(1),F(2,"date"),F(3,"date"),p()),o&2){let a=x().$implicit;f(),so(" Active date (",Ie(2,2,a==null?null:a.StartDate,"dd MMM yyyy")," - ",Ie(3,5,a==null?null:a.ExpirationDate,"dd MMM yyyy"),") ")}}function kS(o,c){if(o&1&&(d(0,"div",11),v(1),F(2,"date"),p()),o&2){let a=x().$implicit;f(),oe(" Active until ",Ie(2,1,a==null?null:a.ExpirationDate,"dd MMMM yyyy")," ")}}function DS(o,c){o&1&&(d(0,"div",11),v(1," No Expiration Date "),p())}function MS(o,c){if(o&1&&(d(0,"tr")(1,"td")(2,"a",10),v(3),p(),k(4,IS,4,8,"div",11)(5,kS,3,4,"div",11)(6,DS,2,0,"div",11),p(),d(7,"td"),v(8),p(),d(9,"td"),v(10),F(11,"number"),p(),d(12,"td"),v(13),F(14,"number"),p()()),o&2){let a=c.$implicit;f(2),M("queryParams",ot(10,SS,a.PricebookID)),f(),oe(" ",a.Name," "),f(),D(a!=null&&a.StartDate&&(a!=null&&a.ExpirationDate)?4:a!=null&&a.ExpirationDate?5:6),f(4),Ae(a.MinimumQuantity),f(2),Ae("Rp "+Ce(11,6,a.UnitPrice)),f(3),Ae(Ce(14,8,a.PriceDiscount)+"%")}}var Lp=class o{pricebooks=Ci([]);constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-pricebook"]],inputs:{pricebooks:[1,"pricebooks"]},standalone:!1,decls:18,vars:0,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],["width","120px",1,"border-end"],["width","100px",1,"border-end"],["width","50px",1,"border-end"],["routerLink","/menu/Promotion/Main/Pricebook/Info","target","_blank",3,"queryParams"],[1,"fst-italic","fw-bold","text-small"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),v(8,"Name"),p(),d(9,"th",7),v(10,"Minimum Quantity"),p(),d(11,"th",8),v(12,"Unit Price"),p(),d(13,"th",9),v(14,"Unit Disc."),p()()(),d(15,"tbody"),Jt(16,MS,15,12,"tr",null,vi),p()()()()()()),a&2&&(f(16),Kt(l.pricebooks()))},dependencies:[li,Li,Vn],encapsulation:2,changeDetection:0})};var TS=()=>["/menu/Promotion/Main/Event/Info"],PS=o=>({ID:o}),BS=o=>({"bg-gradient-warning":o}),NS=(o,c)=>({"bg-success-subtle text-success-emphasis":o,"bg-danger-subtle text-danger-emphasis":c});function FS(o,c){o&1&&(d(0,"th",8),v(1,"Minimum Quantity"),p())}function VS(o,c){o&1&&(d(0,"th",8),v(1,"Minimum Amount"),p())}function RS(o,c){o&1&&(d(0,"th",9),v(1,"Extra Cost"),p())}function OS(o,c){if(o&1&&(d(0,"div",11),v(1),F(2,"MathAbs"),p()),o&2){let a=x().$implicit;f(),oe(" Upcoming - Active in ",Ce(2,1,a.startDays)," Days ")}}function US(o,c){if(o&1&&(d(0,"div",12),v(1),F(2,"date"),F(3,"date"),p()),o&2){let a=x().$implicit;f(),so(" Active date (",Ie(2,2,a.StartDate,a.dateFormat)," - ",Ie(3,5,a.EndDate,a.dateFormat),") ")}}function QS(o,c){if(o&1&&(d(0,"td"),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ",a.MinimumQty>0?Ce(2,1,a.MinimumQty):"-"," ")}}function jS(o,c){if(o&1&&(d(0,"td"),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ","Rp "+Ce(2,1,a.MinimumAmount)," ")}}function LS(o,c){if(o&1&&(d(0,"td"),v(1),F(2,"number"),p()),o&2){let a=x().$implicit;f(),oe(" ","Rp "+Ce(2,1,a.ExtraCost)," ")}}function HS(o,c){o&1&&v(0," - ")}function qS(o,c){if(o&1&&(d(0,"span",15),v(1),p()),o&2){let a=x().$implicit;M("ngClass",Ko(2,NS,a.Enabled,!a.Enabled)),f(),oe(" ",a.Enabled?"Enabled":"Disabled"," ")}}function GS(o,c){if(o&1&&(d(0,"tr")(1,"td")(2,"a",10),v(3),p(),k(4,OS,3,3,"div",11)(5,US,4,8,"div",12),p(),d(6,"td"),v(7),p(),k(8,QS,3,3,"td"),k(9,jS,3,3,"td"),d(10,"td",13),v(11),F(12,"number"),p(),d(13,"td"),v(14),F(15,"number"),p(),k(16,LS,3,3,"td"),d(17,"td",14),k(18,HS,1,0)(19,qS,2,5,"span",15),p()()),o&2){let a=c.$implicit,l=x();f(2),M("routerLink",ft(16,TS))("queryParams",ot(17,PS,a==null?null:a.ID)),f(),oe(" ",a.PromotionName," "),f(),D(a.startDays<0?4:5),f(3),oe(" ",a.PromotionTypeName," "),f(),D(l.hasMinimumQuantity()?8:-1),f(),D(l.hasMinimumAmount()?9:-1),f(),M("ngClass",ot(19,BS,l.hasHigherPromotionPrice)),f(),oe(" ","Rp "+Ce(12,12,a.UnitPrice)," "),f(3),Ae(Ce(15,14,a.Discount)+"%"),f(2),D(l.roleService.product.Cost&&l.hasExtraCost()?16:-1),f(2),D(a.ExpirationDate<l.date()?18:19)}}var Hp=class o{constructor(c){this.roleService=c}roleService;promotions=Ci([]);variant=Ci(void 0);hasMinimumQuantity=Qe(!1);hasMinimumAmount=Qe(!1);hasExtraCost=Qe(!1);date=Qe(new Date);hasHigherPromotionPrice=!1;ngOnInit(){this.evaluatePromotionPrice()}ngOnChanges(c){c.promotions.currentValue&&(this.checkHasMinimumQty(),this.checkHasMinimumAmount(),this.checkHasExtraCost(),this.initDateFormat())}initDateFormat(){this.promotions()?.map(c=>(c.dateFormat=this.getDateFormat(c.StartDate,c.EndDate),c.StartDate=c.StartDate?new Date(c.StartDate):new Date,c.startDays=Qi.differentInDays(c.StartDate,new Date),c))}checkHasMinimumQty(){this.hasMinimumQuantity.set(!1),(this.promotions()?.filter(a=>a.MinimumQty>0)).length>0&&this.hasMinimumQuantity.set(!0)}checkHasMinimumAmount(){this.hasMinimumAmount.set(!1),(this.promotions()?.filter(a=>a.MinimumAmount>0)).length>0&&this.hasMinimumAmount.set(!0)}checkHasExtraCost(){this.hasExtraCost.set(!1),(this.promotions()?.filter(a=>a.ExtraCost>0)).length>0&&this.hasExtraCost.set(!0)}getDateFormat(c,a){let l="dd MMM yyyy";return c&&a&&(c=new Date(c),a=new Date(a),this.getTimeDifference(c,a)>0&&(l="dd MMM yyyy HH:mm")),l}getTimeDifference(c,a){let l=new Date(c),s=new Date(a),m=new Date;m.setHours(l.getHours(),l.getMinutes(),0,0);let h=new Date;return h.setHours(s.getHours(),s.getMinutes(),0,0),h.getTime()-m.getTime()}evaluatePromotionPrice(){let c=this.variant()?.UnitPrice||0;this.hasHigherPromotionPrice=this.promotions()?.some(a=>a.UnitPrice>c)}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-promotion"]],inputs:{promotions:[1,"promotions"],variant:[1,"variant"]},standalone:!1,features:[Wr],decls:23,vars:3,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end",2,"width","10rem"],[1,"border-end",2,"width","4rem"],[1,"border-end",2,"width","8rem"],[1,"border-end",2,"width","5rem"],[3,"routerLink","queryParams"],[1,"text-warning","fst-italic","fw-bold","text-small"],[1,"fst-italic","fw-bold","text-small"],["matTooltip",`
|
|
18
18
|
Promotion price is higher than original price, adjust manual to remove warning sign
|
|
19
|
-
`,3,"ngClass"],[1,""],[1,"p-3","rounded-2",3,"ngClass"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),v(8,"Name"),p(),d(9,"th",7),v(10,"Type"),p(),k(11,FS,2,0,"th",8),k(12,VS,2,0,"th",8),d(13,"th",9),v(14,"Promotion Price"),p(),d(15,"th",9),v(16,"Discount"),p(),k(17,RS,2,0,"th",9),d(18,"th",9),v(19,"Status"),p()()(),d(20,"tbody"),Jt(21,GS,20,21,"tr",null,vi),p()()()()()()),a&2&&(f(11),D(l.hasMinimumQuantity()?11:-1),f(),D(l.hasMinimumAmount()?12:-1),f(5),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost&&l.hasExtraCost()?17:-1),f(4),Kt(l.promotions()))},dependencies:[Ei,Jr,li,Li,Vn,wg],encapsulation:2,changeDetection:0})};var qp=class o{variant=Ci();constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-purchase"]],inputs:{variant:[1,"variant"]},standalone:!1,decls:6,vars:1,consts:[[1,"container-fluid","mt-8"],[1,"row"],[1,"col-sm-4"],["for","expense"],["type","text","id","expense","placeholder","Unit Expense","name","Unit Expense","readonly","",1,"form-control","custom",3,"ngModel"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),v(4,"Unit Expense"),p(),G(5,"input",4),p()()()),a&2){let s;f(5),M("ngModel",(s=l.variant())==null?null:s.UnitExpense)}},dependencies:[Cn,Vi,Ri],styles:[".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var WS=()=>["/menu/Products/Catalog/Serial/Info"],JS=o=>({ID:o});function KS(o,c){if(o&1&&(d(0,"tr")(1,"td")(2,"a",11),v(3),p()(),d(4,"td",12),v(5),F(6,"number"),p(),d(7,"td"),v(8),F(9,"date"),p()()),o&2){let a=c.$implicit;f(2),M("routerLink",ft(10,WS))("queryParams",ot(11,JS,a.ID)),f(),oe(" ",a.Number," "),f(2),oe(" ",Ce(6,5,a.Quantity)," "),f(3),oe(" ",a.ExpiryDate?Ie(9,7,a.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function XS(o,c){if(o&1&&(d(0,"tr")(1,"td",10),v(2),p()(),Jt(3,KS,10,13,"tr",null,vi)),o&2){let a=c.$implicit;f(),M("rowSpan",a.Serial.length+1),f(),oe(" ",a.EntityName," "),f(),Kt(a.Serial)}}function $S(o,c){o&1&&(d(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr",7)(4,"th"),v(5,"Outlet"),p(),d(6,"th",8),v(7,"Number"),p(),d(8,"th",9),v(9,"Quantity"),p(),d(10,"th",8),v(11,"Expiry"),p()()(),d(12,"tbody"),Jt(13,XS,5,2,null,null,vi),p()()()),o&2&&(f(13),Kt(c))}var Gp=class o{constructor(c){this.httpService=c}httpService;set variantId(c){Qi.IsNotEmpty(c)&&this.initSerial(c)}sourceData=Qe([]);outletSerial$;initSerial(c){this.outletSerial$=this.httpService.post(Da.GetVariantSerialByVariantID,{ID:c}).pipe(xo(),C1(a=>{this.sourceData=JSON.parse(JSON.stringify(a))}))}onSort(c,a){if(!c.active||c.direction===""){a=JSON.parse(JSON.stringify(this.sourceData));return}a=a.sort((l,s)=>{let m=c.direction==="asc",h=l.Serial.reduce((w,A)=>A.Quantity>w.Quantity?A:w,l.Serial[0]),_=s.Serial.reduce((w,A)=>A.Quantity>w.Quantity?A:w,s.Serial[0]);switch(c.active){case"Number":return Qi.compare(h.Number,_.Number,m);case"Quantity":return Qi.compare(h.Quantity,_.Quantity,m);default:return 0}})}static \u0275fac=function(a){return new(a||o)(se(ki))};static \u0275cmp=nt({type:o,selectors:[["app-info-variant-nav-serial"]],inputs:{variantId:"variantId"},standalone:!1,decls:6,vars:3,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"content"],[1,"table","custom-table","mt-5"],[1,"thead-light"],[1,"table-secondary"],[2,"width","150px"],[2,"width","50px"],[3,"rowSpan"],[3,"routerLink","queryParams"],[1,"text-end"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),k(4,$S,15,0,"div",4),F(5,"async"),p()()()()),a&2){let s;f(4),D((s=Ce(5,1,l.outletSerial$))?4:-1,s)}},dependencies:[li,w1,Li,Vn],encapsulation:2,changeDetection:0})};var eI=o=>({ID:o}),tI=(o,c)=>c.ID;function iI(o,c){if(o&1&&(d(0,"tr")(1,"td",10)(2,"div"),v(3),p(),d(4,"div",11),v(5),p()(),d(6,"td",10)(7,"a",12),v(8),p()(),d(9,"td",13),v(10),p()()),o&2){let a=c.$implicit;f(3),Ae(a.OutletName||a.OutletID),f(2),oe(" ",a.WarehouseLayoutPlanName," "),f(2),M("queryParams",ot(5,eI,a.ID)),f(),oe(" ",a.ZoneBinCode," "),f(2),oe(" ",a.Code," ")}}var zp=class o{rows=Ci([]);warehouseLayoutZoneBins=Qe([]);originalWarehouseLayoutZoneBins=Qe([]);ngOnChanges(){let c=this.rows()??[];this.warehouseLayoutZoneBins.set(c),this.originalWarehouseLayoutZoneBins.set(c)}sortData(c){let a=this.originalWarehouseLayoutZoneBins().slice();if(!c.active||c.direction===""){this.warehouseLayoutZoneBins.set(this.originalWarehouseLayoutZoneBins());return}this.warehouseLayoutZoneBins.set(a.sort((l,s)=>{let m=c.direction==="asc";return this.compare(this.sortValue(l,c.active),this.sortValue(s,c.active),m)}))}sortValue(c,a){switch(a){case"Outlet":return c.OutletName||c.OutletID;case"Zone":return c.ZoneBinCode??"";case"Bin":return c.Code;default:return""}}compare(c,a,l){return c===a?0:(c<a?-1:1)*(l?1:-1)}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-warehouse"]],inputs:{rows:[1,"rows"]},standalone:!1,features:[Wr],decls:16,vars:0,consts:[[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light"],[1,"table-secondary"],["mat-sort-header","Outlet",1,"border-end",2,"width","250px"],["mat-sort-header","Zone",1,"border-end"],["mat-sort-header","Bin"],[1,"border-end",2,"vertical-align","middle"],[1,"warehouse-outlet-plan","text-muted"],["routerLink","/menu/Warehouses/Warehouse/Bin/Info","target","_blank",3,"queryParams"],[2,"vertical-align","middle"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4),de("matSortChange",function(m){return l.sortData(m)}),d(5,"thead",5)(6,"tr",6)(7,"th",7),v(8," Outlet "),p(),d(9,"th",8),v(10,"Bin"),p(),d(11,"th",9),v(12,"Path"),p()()(),d(13,"tbody"),Jt(14,iI,11,7,"tr",null,tI),p()()()()()()),a&2&&(f(14),Kt(l.warehouseLayoutZoneBins()))},dependencies:[li,S1,I1],styles:[".warehouse-outlet-plan[_ngcontent-%COMP%]{font-size:.85rem}"],changeDetection:0})};var aI=o=>({"bg-gradient-warning":o});function rI(o,c){o&1&&(G(0,"i",13),d(1,"span",14),v(2,"Point"),p())}function oI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,rI,3,0,"ng-template",3),d(2,"div",5)(3,"div",6)(4,"label",7),v(5,"Point"),p(),G(6,"input",8),p(),d(7,"div",6)(8,"label",9),v(9,"Expiration Day(s)"),p(),G(10,"input",10),p(),d(11,"div",6)(12,"label",11),v(13,"Expiration Month(s)"),p(),G(14,"input",12),p()()()),o&2){let a,l,s,m=x();f(6),M("ngModel",(a=m.data())==null||a.Data.VariantPoint==null?null:a.Data.VariantPoint.Point),f(4),M("ngModel",(l=m.data())==null||l.Data.VariantPoint==null?null:l.Data.VariantPoint.ExpiredDay),f(4),M("ngModel",(s=m.data())==null||s.Data.VariantPoint==null?null:s.Data.VariantPoint.ExpiredMonth)}}function lI(o,c){o&1&&(G(0,"i",13),d(1,"span",14),v(2,"Inventory"),p())}function sI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,lI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-inventory",4),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())}}function cI(o,c){o&1&&(G(0,"i",16),d(1,"span",14),v(2,"Warehouse"),p())}function dI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,cI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-warehouse",15),p()),o&2){let a=x();f(2),M("rows",a.warehouseLayoutZoneBins())}}function pI(o,c){o&1&&(G(0,"i",18),d(1,"span",14),v(2,"Outlet Group"),p())}function mI(o,c){o&1&&(G(0,"i",20),d(1,"span",14),v(2,"Days Of"),p())}function fI(o,c){if(o&1&&G(0,"app-info-variant-mav-forecast",4),o&2){let a=x(3);M("variantInfoModel",a.data())}}function uI(o,c){o&1&&(d(0,"mat-tab"),_i(1,mI,3,0,"ng-template",3)(2,fI,1,1,"ng-template",19),p())}function vI(o,c){if(o&1&&(G(0,"i",21),d(1,"span",14),v(2),p()),o&2){x(2);let a=Qs(4);f(2),Ae(a?"Serial":"Batch Number")}}function gI(o,c){if(o&1&&G(0,"app-info-variant-nav-serial",22),o&2){let a,l=x(3);M("variantId",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function bI(o,c){o&1&&(d(0,"mat-tab"),_i(1,vI,3,1,"ng-template",3)(2,gI,1,1,"ng-template",19),p())}function hI(o,c){o&1&&(G(0,"i",24),d(1,"span",14),v(2,"Component"),p())}function xI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,hI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-component",23),p()),o&2){let a=x(2);f(2),M("composites",a.composites())("currencies",a.currencies())}}function _I(o,c){o&1&&(G(0,"i",25),d(1,"span",14),v(2,"Outlet Price"),p())}function CI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,_I,3,0,"ng-template",3),G(2,"POS-info-variant-nav-outlet-price",4),p()),o&2){let a=x(2);f(2),M("variantInfoModel",a.data())}}function yI(o,c){o&1&&(G(0,"i",27),d(1,"span",14),v(2,"Pricebook"),p())}function wI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,yI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-pricebook",26),p()),o&2){let a=x(2);f(2),M("pricebooks",a.pricebooks())}}function AI(o,c){o&1&&(G(0,"i",29),d(1,"span",14),v(2,"Promotion"),p())}function SI(o,c){if(o&1&&(d(0,"mat-tab",17),_i(1,AI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-promotion",28),p()),o&2){let a=x(2);M("labelClass",ot(3,aI,a.hasHigherPromotionPrice)),f(2),M("promotions",a.promotions())("variant",a.variant())}}function II(o,c){o&1&&(G(0,"i",30),d(1,"span",14),v(2,"Purchase"),p())}function kI(o,c){o&1&&(d(0,"mat-tab"),_i(1,II,3,0,"ng-template",3),G(2,"POS-info-variant-nav-purchase"),p())}function DI(o,c){o&1&&(G(0,"i",32),d(1,"span",14),v(2,"Description"),p())}function MI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,DI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-description",31),p()),o&2){let a=x(2);f(2),M("variant",a.variant())}}function EI(o,c){o&1&&(G(0,"i",34),d(1,"span",14),v(2,"Commission"),p())}function TI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,EI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-commision",33),p()),o&2){let a=x(2);f(2),M("variantInfoModel",a.data())("role",a.roleService==null||a.roleService.product==null?null:a.roleService.product.CommissionView)}}function PI(o,c){o&1&&(G(0,"i",36),d(1,"span",14),v(2,"Dependency Of"),p())}function BI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,PI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-dependency-of",35),p()),o&2){let a=x(2);f(2),M("dependencyOf",a.dependencyOf())}}function NI(o,c){o&1&&(G(0,"i",13),d(1,"span",14),v(2,"Inventory"),p())}function FI(o,c){o&1&&(G(0,"i",16),d(1,"span",14),v(2,"Warehouse"),p())}function VI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,FI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-warehouse",15),p()),o&2){let a=x(2);f(2),M("rows",a.warehouseLayoutZoneBins())}}function RI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,pI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-group-inventory",4),p(),k(3,uI,3,0,"mat-tab"),Us(4),k(5,bI,3,0,"mat-tab"),k(6,xI,3,2,"mat-tab"),k(7,CI,3,1,"mat-tab"),k(8,wI,3,1,"mat-tab"),k(9,SI,3,5,"mat-tab",17),k(10,kI,3,0,"mat-tab"),k(11,MI,3,1,"mat-tab"),k(12,TI,3,2,"mat-tab"),k(13,BI,3,1,"mat-tab"),d(14,"mat-tab"),_i(15,NI,3,0,"ng-template",3),G(16,"POS-info-variant-nav-inventory",4),p(),k(17,VI,3,1,"mat-tab")),o&2){let a,l,s,m,h,_,w,A=x();f(2),M("variantInfoModel",A.data()),f(),D(!(A.roleService==null||A.roleService.inventory==null)&&A.roleService.inventory.View?3:-1);let I=((a=A.data())==null||a.Data==null?null:a.Data.Variant.TypeID)==A.variantType.BatchNumber;f();let P=sc(((l=A.data())==null||l.Data==null?null:l.Data.Variant.TypeID)==A.variantType.Serialized);f(),D(P||I?5:-1),f(),D(((s=A.composites())==null?null:s.length)>0?6:-1),f(),D(((m=A.outletPrices())==null?null:m.length)>0?7:-1),f(),D(A.pricebooks().length!==0&&(!(A.roleService==null||A.roleService.promotion==null)&&A.roleService.promotion.Pricebook)&&(!(A.roleService==null||A.roleService.promotion==null)&&A.roleService.promotion.View)?8:-1),f(),D(A.promotions().length!==0&&(!(A.roleService==null||A.roleService.promotion==null)&&A.roleService.promotion.View)?9:-1),f(),D(!(A.roleService==null||A.roleService.product==null)&&A.roleService.product.Expense&&((h=A.variant())==null?null:h.UnitExpense)!==0?10:-1),f(),D((_=A.variant())!=null&&_.Description?11:-1),f(),D(((w=A.variant())==null?null:w.SalesCommission)!=0||A.commisions().length!==0&&(!(A.roleService==null||A.roleService.product==null)&&A.roleService.product.CommissionView)?12:-1),f(),D(A.dependencyOf().length>0?13:-1),f(3),M("variantInfoModel",A.data()),f(),D(A.warehouseLayoutZoneBins().length?17:-1)}}function OI(o,c){o&1&&(G(0,"i",38),d(1,"span",14),v(2,"Composite Inventory"),p())}function UI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,OI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-composite-inventory",37),p()),o&2){let a,l=x();f(2),M("totalCompositeInventory",l.totalCompositeInventory())("compositeInventories",l.compositeInventories())("variantID",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function QI(o,c){o&1&&(G(0,"i",39),d(1,"span",14),v(2,"History"),p())}function jI(o,c){if(o&1&&G(0,"POS-info-variant-nav-history",22),o&2){let a,l=x(2);M("variantId",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function LI(o,c){o&1&&(d(0,"mat-tab"),_i(1,QI,3,0,"ng-template",3)(2,jI,1,1,"ng-template",19),p())}function HI(o,c){o&1&&(G(0,"i",18),d(1,"span",14),v(2,"Outlet Group"),p())}function qI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,HI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-group-inventory",4),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())}}function GI(o,c){o&1&&(G(0,"i",20),d(1,"span",14),v(2,"Days Of"),p())}function zI(o,c){if(o&1&&G(0,"app-info-variant-mav-forecast",4),o&2){let a=x(2);M("variantInfoModel",a.data())}}function YI(o,c){o&1&&(d(0,"mat-tab"),_i(1,GI,3,0,"ng-template",3)(2,zI,1,1,"ng-template",19),p())}function WI(o,c){if(o&1&&(G(0,"i",21),d(1,"span",14),v(2),p()),o&2){x(2);let a=Qs(11);f(2),Ae(a?"Serial":"Batch Number")}}function JI(o,c){if(o&1&&G(0,"app-info-variant-nav-serial",22),o&2){let a,l=x(2);M("variantId",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function KI(o,c){o&1&&(d(0,"mat-tab"),_i(1,WI,3,1,"ng-template",3)(2,JI,1,1,"ng-template",19),p())}function XI(o,c){o&1&&(G(0,"i",24),d(1,"span",14),v(2,"Component"),p())}function $I(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,XI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-component",23),p()),o&2){let a=x();f(2),M("composites",a.composites())("currencies",a.currencies())}}function ZI(o,c){o&1&&(G(0,"i",25),d(1,"span",14),v(2,"Outlet Price"),p())}function ek(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,ZI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-outlet-price",4),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())}}function tk(o,c){o&1&&(G(0,"i",27),d(1,"span",14),v(2,"Pricebook"),p())}function ik(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,tk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-pricebook",26),p()),o&2){let a=x();f(2),M("pricebooks",a.pricebooks())}}function nk(o,c){o&1&&(G(0,"i",29),d(1,"span",14),v(2,"Promotion"),p())}function ak(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,nk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-promotion",40),p()),o&2){let a=x();f(2),M("promotions",a.promotions())}}function rk(o,c){o&1&&(G(0,"i",30),d(1,"span",14),v(2,"Purchase"),p())}function ok(o,c){o&1&&(d(0,"mat-tab"),_i(1,rk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-purchase"),p())}function lk(o,c){o&1&&(G(0,"i",32),d(1,"span",14),v(2,"Description"),p())}function sk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,lk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-description",31),p()),o&2){let a=x();f(2),M("variant",a.variant())}}function ck(o,c){o&1&&(G(0,"i",34),d(1,"span",14),v(2,"Commission"),p())}function dk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,ck,3,0,"ng-template",3),G(2,"POS-info-variant-nav-commision",33),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())("role",a.roleService==null||a.roleService.product==null?null:a.roleService.product.CommissionView)}}function pk(o,c){o&1&&(G(0,"i",36),d(1,"span",14),v(2,"Dependency Of"),p())}function mk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,pk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-dependency-of",35),p()),o&2){let a=x();f(2),M("dependencyOf",a.dependencyOf())}}function fk(o,c){o&1&&(G(0,"i",41),d(1,"span",14),v(2,"Advanced"),p())}function uk(o,c){o&1&&(G(0,"i",43),d(1,"span",14),v(2," Multi Unit "),p())}function vk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,uk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-multi-unit",42),p()),o&2){let a,l=x();f(2),M("variantInfoModel",l.data())("variantType",(a=l.variant())==null?null:a.TypeID)}}var Yp=class o{constructor(c){this.roleService=c;this.outletPrices.set([]),this.pricebooks.set([]),this.commisions.set([]),this.compositeInventories.set([])}roleService;data=Ci();outletPrices=Qe([]);pricebooks=Qe([]);commisions=Qe([]);totalCompositeInventory=Qe(void 0);promotions=Qe([]);compositeInventories=Qe([]);dependencyOf=Qe([]);warehouseLayoutZoneBins=Qe([]);composites=Qe([]);currencies=Qe([]);variant=Qe(new tf);variantParent=Qe(new nf);variantType=g1;hasHigherPromotionPrice=!1;ngOnInit(){this.evaluatePromotionPrice()}ngAfterViewInit(){let c=document.querySelector(".inventory-nav-tab .nav-link"),a=document.querySelector(".inventory-content.tab-content .tab-pane");c&&c.classList?.add("active"),a&&(a.classList?.add("show"),a.classList?.add("active"))}ngOnChanges(){if(this.data()?.Data){this.outletPrices.set(this.data()?.Data.OutletPrice||[]),this.commisions.set(this.data()?.Data.Commission||[]),this.pricebooks.set(this.data()?.Data.Pricebook||[]),this.promotions.set(this.data()?.Data.Promotion||[]),this.compositeInventories.set(this.data()?.Data.CompositeInventory||[]),this.dependencyOf.set(this.data()?.Data.DependencyOf||[]),this.warehouseLayoutZoneBins.set(this.flattenWarehouseLayoutZoneBins()),this.composites.set(this.data()?.Data.Composites||[]),this.variant.set(this.data()?.Data.Variant||new tf),this.variantParent.set(this.data()?.Data.VariantParent||new nf),this.currencies.set(this.data()?.Data.Currencies||[]),this.totalCompositeInventory.set(this.data()?.Data.TotalCompositeInventory);let c=this.data()?.Data.EntityStockOutlet.map(a=>a.PickPack)}}flattenWarehouseLayoutZoneBins(){return(this.data()?.Data?.WarehouseLayouts??[]).flatMap(c=>(c.WarehouseLayoutZoneBins??[]).map(a=>({ID:a.ID,OutletID:c.OutletId,OutletName:c.OutletName,WarehouseLayoutPlanName:c.WarehouseLayoutPlanName,Code:a.Code,ZoneBinCode:a.ZoneBinCode})))}get hasAnyHistoryTab(){return this.roleService?.report?.View||this.roleService?.adjustment?.View||this.roleService?.logistic?.View||this.roleService?.order?.View}evaluatePromotionPrice(){let c=this.data()?.Data.Variant.UnitPrice||0;this.hasHigherPromotionPrice=this.promotions()?.some(a=>a.UnitPrice>c)}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav"]],inputs:{data:[1,"data"]},standalone:!1,features:[Wr],decls:25,vars:21,consts:[[1,"card","border-top-0"],[1,"card-body","pt-2"],[1,"variant-info-tab",3,"mat-stretch-tabs"],["mat-tab-label",""],[3,"variantInfoModel"],[1,"row","mt-3",2,"padding","0","width","100%"],[1,"col-4"],["for","inputPoint"],["type","text","id","inputPoint","matTooltipPosition","above","matTooltip","Input Point for this variant","placeholder","Point","autoNum","",1,"form-control","custom",3,"ngModel"],["for","inputDays"],["type","text","id","inputDays","matTooltipPosition","above","matTooltip","Input Expired Days for this variant","placeholder","Day(s)","autoNum","",1,"form-control","custom",3,"ngModel"],["for","inputMonth"],["type","text","id","inputMonth","matTooltipPosition","above","matTooltip","Input Expired Months for this variant","placeholder","Month(s)","autoNum","",1,"form-control","custom",3,"ngModel"],[1,"fa-solid","fa-archive","me-3","pb-1"],[1,"fs-5"],[3,"rows"],[1,"fa-solid","fa-warehouse","me-3","pb-1"],[3,"labelClass"],[1,"fa-solid","fa-map-marker-alt","me-3","pb-1"],["matTabContent",""],[1,"fa-solid","fa-hourglass-half","me-3","pb-1"],[1,"fa-solid","fa-barcode","me-3","pb-1"],[3,"variantId"],[3,"composites","currencies"],[1,"fa-regular","fa-sitemap","me-3","pb-1"],[1,"fa-solid","fa-dollar","me-3"],[3,"pricebooks"],[1,"fa-solid","fa-tag","me-3","pb-1"],[3,"promotions","variant"],[1,"fa-solid","fa-bullhorn","me-3","pb-1"],[1,"fa-regular","fa-cart-shopping","me-3","pb-1"],[3,"variant"],[1,"fa-solid","fa-text","me-3","pb-1"],[3,"variantInfoModel","role"],[1,"fa-solid","fa-money-bill-1-wave","me-3","pb-1"],[3,"dependencyOf"],[1,"fa-solid","fa-link","me-3","pb-1"],[3,"totalCompositeInventory","compositeInventories","variantID"],[1,"fa-solid","fa-boxes-stacked","me-3","pb-1"],[1,"fa-solid","fa-clock-rotate-left","me-3","pb-1"],[3,"promotions"],[1,"fa-solid","fa-gear","me-3","pb-1"],[3,"variantInfoModel","variantType"],[1,"fa-regular","fa-landmark","me-3","pb-1"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"mat-tab-group",2),k(3,oI,15,3,"mat-tab"),k(4,sI,3,1,"mat-tab"),k(5,dI,3,1,"mat-tab"),k(6,RI,18,14),k(7,UI,3,3,"mat-tab"),k(8,LI,3,0,"mat-tab"),k(9,qI,3,1,"mat-tab"),k(10,YI,3,0,"mat-tab"),Us(11),k(12,KI,3,0,"mat-tab"),k(13,$I,3,2,"mat-tab"),k(14,ek,3,1,"mat-tab"),k(15,ik,3,1,"mat-tab"),k(16,ak,3,1,"mat-tab"),k(17,ok,3,0,"mat-tab"),k(18,sk,3,1,"mat-tab"),k(19,dk,3,2,"mat-tab"),k(20,mk,3,1,"mat-tab"),d(21,"mat-tab"),_i(22,fk,3,0,"ng-template",3),G(23,"POS-info-variant-nav-advanced",4),p(),k(24,vk,3,2,"mat-tab"),p()()()),a&2){let s,m,h,_,w,A,I,P,T,B,L,N,Y;f(2),M("mat-stretch-tabs",!1);let ee=((s=l.data())==null||s.Data==null||s.Data.Variant==null?null:s.Data.Variant.TypeID)==l.variantType.PrepaidPackage||((s=l.data())==null||s.Data==null||s.Data.Variant==null?null:s.Data.Variant.TypeID)==l.variantType.PrepaidPoint;f(),D(ee?3:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View&&((m=l.data())==null?null:m.Data.Variant.TypeID)!==l.variantType.Composite?4:-1),f(),D(l.warehouseLayoutZoneBins().length?5:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View&&((h=l.data())!=null&&h.Data.VariantParent)&&((h=l.data())==null?null:h.Data.Variant.TypeID)===l.variantType.Composite?6:-1),f(),D(((_=l.data())==null?null:_.Data.Variant.TypeID)===l.variantType.Composite?7:-1),f(),D(l.hasAnyHistoryTab?8:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View&&((w=l.data())==null?null:w.Data.Variant.TypeID)!==l.variantType.Composite?9:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View?10:-1);let ie=((A=l.data())==null||A.Data==null?null:A.Data.Variant.TypeID)==l.variantType.BatchNumber;f();let K=sc(((I=l.data())==null||I.Data==null?null:I.Data.Variant.TypeID)==l.variantType.Serialized);f(),D(K||ie?12:-1),f(),D(((P=l.composites())==null?null:P.length)>0?13:-1),f(),D(((T=l.outletPrices())==null?null:T.length)>0&&(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Price)?14:-1),f(),D(l.pricebooks().length!==0&&(!(l.roleService==null||l.roleService.promotion==null)&&l.roleService.promotion.Pricebook)&&(!(l.roleService==null||l.roleService.promotion==null)&&l.roleService.promotion.View)?15:-1),f(),D(l.promotions().length!==0&&(!(l.roleService==null||l.roleService.promotion==null)&&l.roleService.promotion.View)?16:-1),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Expense&&((B=l.variant())==null?null:B.UnitExpense)!==0?17:-1),f(),D((L=l.variant())!=null&&L.Description?18:-1),f(),D(((N=l.variant())==null?null:N.SalesCommission)!=0||l.commisions().length!==0&&(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.CommissionView)?19:-1),f(),D(l.dependencyOf().length>0?20:-1),f(3),M("variantInfoModel",l.data()),f(),D(((Y=l.variant())==null?null:Y.TypeID)==l.variantType.MultipleUOM||((Y=l.variant())==null?null:Y.TypeID)==l.variantType.BaseUnit?24:-1)}},dependencies:[Ei,Cn,Vi,Ri,Pv,U2,Q2,j2,_o,ws,Tp,Pp,Bp,Np,Fp,Vp,Rp,Op,Up,Qp,jp,Lp,Hp,qp,Gp,zp],styles:["mat-tab-group.variant-info-tab mat-tab-header{border-bottom:1px solid #e0e0e0}",".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var bk=()=>["/menu/Products/Log/Variant_History"],d4=o=>({VariantID:o}),hk=()=>["/menu/Products/Catalog/Variants/Inventory_Cost_History"],xk=()=>["/menu/Products/Catalog/Variants/Form"],_k=o=>({ID:o});function Ck(o,c){if(o&1&&(d(0,"a",16),G(1,"i",17),v(2,"\xA0\xA0Inventory Cost"),p()),o&2){let a,l=x(3);M("routerLink",ft(2,hk))("queryParams",ot(3,d4,(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID))}}function yk(o,c){if(o&1&&(d(0,"div",1),k(1,Ck,3,5,"a",16),p()),o&2){let a=x(2);f(),D(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Edit?1:-1)}}function wk(o,c){if(o&1&&(d(0,"a",3),G(1,"i",18),v(2,"\xA0\xA0Edit"),p()),o&2){let a,l=x(2);M("routerLink",ft(2,xk))("queryParams",ot(3,_k,(a=l.data())==null?null:a.Data.Variant.ID))}}function Ak(o,c){o&1&&G(0,"button",4)}function Sk(o,c){if(o&1){let a=Se();d(0,"a",19),de("click",function(){U(a);let s=x(2);return Q(s.deleteVariantInfo())}),G(1,"i",20),v(2,"\xA0\xA0Delete"),p()}}function Ik(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",0)(1,"actions"),k(2,yk,2,1,"div",1),d(3,"div",2),k(4,wk,3,5,"a",3),k(5,Ak,1,0,"button",4),d(6,"ul",5)(7,"li")(8,"a",6),de("click",function(){U(a);let s=x();return Q(s.detachToNewProduct(s.data().Data.Variant.ID))}),v(9,"Detach to New Product "),p()()()(),k(10,Sk,3,0,"a",7),p(),d(11,"content")(12,"div",8)(13,"POS-personal-information",9),de("imageUploadSuccess",function(){U(a);let s=x();return Q(s.reloadVariantInfo())}),p(),G(14,"POS-cost-and-price",10),d(15,"div",11)(16,"div",12),G(17,"POS-info-variant-nav",13),p()(),d(18,"div",14)(19,"div",12),G(20,"POS-timeline",15),p()()()()()}if(o&2){let a,l,s,m=x();M("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",m.menuData()),f(2),D(!((a=m.data())==null||a.Config==null)&&a.Config.IsFIFO?2:-1),f(2),D(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit?4:-1),f(),D(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit?5:-1),f(5),D(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Delete?10:-1),f(3),M("data",m.data()),f(),M("data",m.data())("outletPriceVisible",m.outletPriceVisible())("priceFormExpanded",m.priceFormExpanded()),f(3),M("data",m.data())("role",m.data()),f(3),M("viewLink",ft(17,bk))("queryParams",ot(18,d4,(l=m.data())==null?null:l.Data.Variant.ID))("items",m.timelineData)("created",((s=m.data())==null||s.Data==null||s.Data.DocumentInfo==null?null:s.Data.DocumentInfo.Created)??null)}}var kk={Unknown:"Unknown",UpdateEntry:"Variant Updated",Buy:"Cost Changed",Manufacture:"Cost Changed",CSV:"CSV Import",VoidInvoice:"Void Invoice",LandedCost:"Landed Cost Changed"},c4=BiggerPicture({target:document.body}),Wp=class o extends e1{constructor(a,l,s,m,h,_,w){super(a,l,"catalog/variant/GetVariantInfoModelById",s);this.httpService=l;this.activatedRoute=s;this.router=m;this.toaster=h;this.title=_;this.roleService=w;this.destroy$=new ps,this.router.routeReuseStrategy.shouldReuseRoute=function(){return!1}}httpService;activatedRoute;router;toaster;title;roleService;AutoGenerateCode=Qe("");destroy$;outletPriceVisible=Qe(!1);isPrepaidPoint=Qe(!1);isPrepaidPackage=Qe(!1);IsPurchaseRoleHistory=Qe(!1);paymentType=mf;maskingFields;priceFormExpanded=Qe(!1);timelineData=[];timelineLoading=!1;cdr=dn(k2);initRoles(){this.outletPriceVisible.set(this.roleService.product.Cost),this.IsPurchaseRoleHistory.set(this.roleService.buy.Create&&this.roleService.report.View),this.isPrepaidPoint.set(this.data()?.Data?.Variant?.TypeID==13),this.isPrepaidPackage.set(this.data()?.Data?.Variant?.TypeID==10)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}reloadVariantInfo(){let a=this.activatedRoute.snapshot.queryParams;this.httpService.post("/api/catalog/variant/GetVariantInfoModelById",a).subscribe(l=>{this.data.set(l),this.postBindForm(l)})}formattedDescription(a){return a.replace(/\n/g,"<br>")}postBindForm(a){this.menuData().H=a.Data.PageTitle;let l=this.title.getTitle().split("|")[0],s=this.data()?.Data?.Variant?.Name;this.title.setTitle(`${l}| ${s}`),this.maskingFields=Qi.generateMaskingField(a.Config?.MaskFields),this.initRoles(),this.data().Data.Variant.Description=this.formattedDescription(a.Data.Variant.Description),this.fetchVariantTimeline()}fetchVariantTimeline(){let a=this.data()?.Data?.Variant?.ID;a&&(this.timelineLoading=!0,this.httpService.get(`/API/catalog/variant/Timeline/${a}`).subscribe({next:l=>{this.timelineData=Vd(l?.Data,kk),this.timelineLoading=!1,this.cdr.markForCheck()},error:()=>{this.timelineData=[],this.timelineLoading=!1,this.cdr.markForCheck()}}))}deleteVariantInfo(){confirm("Are you sure you want to delete this record?")&&(this.data().Form={ID:this.data().Data.Variant.ID},this.onSubmit("catalog/variant/DeleteVariantInfo"))}onSubmitSuccess(){this.router.navigate(["/menu/Products/Catalog/Variants"]),this.toaster.success("Success Delete Variant",Zi.Success)}detachToNewProduct(a){this.httpService.post("/api/catalog/variant/DetachToNewProduct",{ID:a}).subscribe(()=>{this.toaster.success("Success detach to new product","Success")})}get variantName(){if(this.data&&this.data().Data&&this.data().Data.Product){let l=`${this.data().Data.Product.Display}`;return{name:l.length>40?`${l.slice(0,40)}...`:l,tooltip:l.length>40?l:""}}return""}openGalery(a){a.preventDefault();let l=a.target.parentElement,s=l?.attributes?.getNamedItem("href")?.value;if(s?.startsWith("data:image/svg+xml")){let m=new Blob([decodeURIComponent(s?.split(",")[1])],{type:"image/svg+xml"}),h=URL.createObjectURL(m);c4.open({items:[{img:h,height:300,width:300}],el:l,intro:"fadeup",noPinch:_=>_.clientWidth<800,maxZoom:1}),setTimeout(()=>URL.revokeObjectURL(h),5e3)}else c4.open({items:[s],el:l})}onInputChange(a,l){try{let s=this.data()?.Data?.Variant;if(!s)return;if(["UnitCost","UnitPrice","Weight","OrderPrice","UnitPriceMinimum","MaxOrderPrice"].includes(a)){let h=parseFloat((l||"").toString().replace(/,/g,""));s[a]=isNaN(h)?0:h}else a==="VariantType"?s.VariantType=l:a==="Taxable"?s.Taxable=l==="Yes"||l===!0:a==="LoyaltyPoint"?s.LoyaltyPoint=l==="Yes"||l===!0:a==="Discontinued"?s.Discontinued=l==="Yes"||l===!0:s[a]=l;this.cdr.markForCheck()}catch(s){console.error("onInputChange error",s)}}get showCostCurrencySymbol(){let a=this.data().Data.Currencies.find(l=>l.Primary===!0);return this.data().Data.Currencies.length>1&&a.ID!==this.data().Data.Variant.CostCurrencyID}get showPriceCurrencySymbol(){let a=this.data().Data.Currencies.find(l=>l.Primary===!0);return this.data().Data.Currencies.length>1&&a.ID!==this.data().Data.Variant.PriceCurrencyID}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(Jn),se(ir),se(zi),se(dc),se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-v2"]],features:[$i],decls:1,vars:1,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],[1,"btn-group"],[1,"btn-group","ms-5"],[1,"btn","btn-outline-secondary","border-end-0",3,"routerLink","queryParams"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],["role","button",1,"dropdown-item",3,"click"],["role","button",1,"btn","btn-outline-secondary","ms-3"],[1,"container-fluid","bg-light-gray","pt-8","m-0","d-flex","flex-column","gap-6"],[3,"imageUploadSuccess","data"],[3,"data","outletPriceVisible","priceFormExpanded"],[1,"row","mb-2","mt-4"],[1,"col-12"],[3,"data","role"],[1,"row"],["variant","compact",3,"viewLink","queryParams","items","created"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-clock-rotate-left"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary","ms-3",3,"click"],[1,"fa","fa-trash"]],template:function(l,s){if(l&1&&k(0,Ik,21,20,"mainpanel-cmp",0),l&2){let m;D((m=s.data())!=null&&m.Data?0:-1)}},dependencies:[hc,tn,bc,li,nr,tr,Cp,yp,Dp,Yp,wc],encapsulation:2,changeDetection:0})};var Dk=[{path:"Catalog/Categories",component:$d},{path:"Catalog/Categories/Form",component:Zd},{path:"Catalog/Categories/Info",component:ep},{path:"Catalog/Products",component:Bd},{path:"Catalog/Products/Form",loadComponent(){return import("./chunk-ZABYOGLE.js").then(o=>o.ProductFormComponent)}},{path:"Catalog/Products/Info",component:Qd},{path:"Catalog/Products/Import",component:fp},{path:"Catalog/Products/Inventory",component:rp},{path:"Catalog/Variants",component:jd},{path:"Catalog/Variants/Form",loadComponent:()=>import("./chunk-L2TXH3DT.js").then(o=>o.FormVariantV2Component)},{path:"Catalog/Variants/Info",component:Wp},{path:"Catalog/Variants/Log",component:ip},{path:"Catalog/Variants/Serial_Form",component:ap},{path:"Catalog/Serial",component:op},{path:"Catalog/Serial/Import",loadComponent:()=>import("./chunk-PECFN37U.js").then(o=>o.ImportSerialV2Component)},{path:"Catalog/Serial/Import/V1",component:pp},{path:"Catalog/Serial/Form",component:lp},{path:"Catalog/Serial/Info",component:sp},{path:"Log/Variant_History",component:Hd},{path:"Log/Product_History",loadComponent:()=>import("./chunk-HAUJALUH.js").then(o=>o.ProductUpdateHistoryComponent)},{path:"Log/Product_Import_Log",component:up},{path:"Price_Editor/Custom_Outlet_Price",component:qd},{path:"Setup/Brand",component:Gd},{path:"Setup/Brand/Brand_Info",loadComponent:()=>import("./chunk-ZBZPU43T.js").then(o=>o.BrandInfoComponent)},{path:"Setup/Brand/Brand_Form",component:Jd},{path:"Setup/Measurement",component:zd},{path:"Setup/Measurement/Form",component:Kd},{path:"Setup/Tags",component:Yd},{path:"Setup/Tags/Tags_Form",component:p0},{path:"Setup/Tags/Info",component:vp},{path:"Setup/Tags/Form",component:p0},{path:"Setup/UOM",component:Wd},{path:"Setup/UOM/Form",component:Xd},{path:"",redirectTo:"Catalog/Products",pathMatch:"full"}],Qc=class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=lc({type:o});static \u0275inj=ac({imports:[v1.forChild(Dk),v1]})};var p4=class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=lc({type:o});static \u0275inj=ac({providers:[kv],imports:[gs,cd,id,yd,Id,z2,Ac,nr,hc,tr,bc,Qc,Xo,dd,mc,P2,N2,V2,R2,O2,md,F2,L2,H2,q2,$o,fc,B2,Xr,Co,fd,K2,sd,il,fc,bd,Cc,nd,Kr,hd,vd,_c,gd,td,k1,Zo,pd,yc,ed,ad,$2,Ic,kc,ws,Sd,Ml,tl,od,kd,xd,ud,Sc,rd,Dd,Ag,xc,wc]})};export{p4 as ProductModule};
|
|
19
|
+
`,3,"ngClass"],[1,""],[1,"p-3","rounded-2",3,"ngClass"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),v(8,"Name"),p(),d(9,"th",7),v(10,"Type"),p(),k(11,FS,2,0,"th",8),k(12,VS,2,0,"th",8),d(13,"th",9),v(14,"Promotion Price"),p(),d(15,"th",9),v(16,"Discount"),p(),k(17,RS,2,0,"th",9),d(18,"th",9),v(19,"Status"),p()()(),d(20,"tbody"),Jt(21,GS,20,21,"tr",null,vi),p()()()()()()),a&2&&(f(11),D(l.hasMinimumQuantity()?11:-1),f(),D(l.hasMinimumAmount()?12:-1),f(5),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Cost&&l.hasExtraCost()?17:-1),f(4),Kt(l.promotions()))},dependencies:[Ei,Jr,li,Li,Vn,wg],encapsulation:2,changeDetection:0})};var qp=class o{variant=Ci();constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-purchase"]],inputs:{variant:[1,"variant"]},standalone:!1,decls:6,vars:1,consts:[[1,"container-fluid","mt-8"],[1,"row"],[1,"col-sm-4"],["for","expense"],["type","text","id","expense","placeholder","Unit Expense","name","Unit Expense","readonly","",1,"form-control","custom",3,"ngModel"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),v(4,"Unit Expense"),p(),G(5,"input",4),p()()()),a&2){let s;f(5),M("ngModel",(s=l.variant())==null?null:s.UnitExpense)}},dependencies:[Cn,Vi,Ri],styles:[".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var WS=()=>["/menu/Products/Catalog/Serial/Info"],JS=o=>({ID:o});function KS(o,c){if(o&1&&(d(0,"tr")(1,"td")(2,"a",11),v(3),p()(),d(4,"td",12),v(5),F(6,"number"),p(),d(7,"td"),v(8),F(9,"date"),p()()),o&2){let a=c.$implicit;f(2),M("routerLink",ft(10,WS))("queryParams",ot(11,JS,a.ID)),f(),oe(" ",a.Number," "),f(2),oe(" ",Ce(6,5,a.Quantity)," "),f(3),oe(" ",a.ExpiryDate?Ie(9,7,a.ExpiryDate,"dd MMM yyyy"):"-"," ")}}function XS(o,c){if(o&1&&(d(0,"tr")(1,"td",10),v(2),p()(),Jt(3,KS,10,13,"tr",null,vi)),o&2){let a=c.$implicit;f(),M("rowSpan",a.Serial.length+1),f(),oe(" ",a.EntityName," "),f(),Kt(a.Serial)}}function $S(o,c){o&1&&(d(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr",7)(4,"th"),v(5,"Outlet"),p(),d(6,"th",8),v(7,"Number"),p(),d(8,"th",9),v(9,"Quantity"),p(),d(10,"th",8),v(11,"Expiry"),p()()(),d(12,"tbody"),Jt(13,XS,5,2,null,null,vi),p()()()),o&2&&(f(13),Kt(c))}var Gp=class o{constructor(c){this.httpService=c}httpService;set variantId(c){Qi.IsNotEmpty(c)&&this.initSerial(c)}sourceData=Qe([]);outletSerial$;initSerial(c){this.outletSerial$=this.httpService.post(Da.GetVariantSerialByVariantID,{ID:c}).pipe(xo(),C1(a=>{this.sourceData=JSON.parse(JSON.stringify(a))}))}onSort(c,a){if(!c.active||c.direction===""){a=JSON.parse(JSON.stringify(this.sourceData));return}a=a.sort((l,s)=>{let m=c.direction==="asc",h=l.Serial.reduce((w,A)=>A.Quantity>w.Quantity?A:w,l.Serial[0]),_=s.Serial.reduce((w,A)=>A.Quantity>w.Quantity?A:w,s.Serial[0]);switch(c.active){case"Number":return Qi.compare(h.Number,_.Number,m);case"Quantity":return Qi.compare(h.Quantity,_.Quantity,m);default:return 0}})}static \u0275fac=function(a){return new(a||o)(se(ki))};static \u0275cmp=nt({type:o,selectors:[["app-info-variant-nav-serial"]],inputs:{variantId:"variantId"},standalone:!1,decls:6,vars:3,consts:[[1,"container-fluid","mt-6"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"content"],[1,"table","custom-table","mt-5"],[1,"thead-light"],[1,"table-secondary"],[2,"width","150px"],[2,"width","50px"],[3,"rowSpan"],[3,"routerLink","queryParams"],[1,"text-end"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),k(4,$S,15,0,"div",4),F(5,"async"),p()()()()),a&2){let s;f(4),D((s=Ce(5,1,l.outletSerial$))?4:-1,s)}},dependencies:[li,w1,Li,Vn],encapsulation:2,changeDetection:0})};var eI=o=>({ID:o}),tI=(o,c)=>c.ID;function iI(o,c){if(o&1&&(d(0,"tr")(1,"td",11)(2,"div"),v(3),p(),d(4,"div",12),v(5),p()(),d(6,"td",11),v(7),p(),d(8,"td",11)(9,"a",13),v(10),p()(),d(11,"td",14),v(12),p()()),o&2){let a=c.$implicit;f(3),Ae(a.OutletName||a.OutletID),f(2),oe(" ",a.WarehouseLayoutPlanName," "),f(2),oe(" ",a.ZoneName||"-"," "),f(2),M("queryParams",ot(6,eI,a.ID)),f(),oe(" ",a.ZoneBinCode," "),f(2),oe(" ",a.Code," ")}}var zp=class o{rows=Ci([]);warehouseLayoutZoneBins=Qe([]);originalWarehouseLayoutZoneBins=Qe([]);ngOnChanges(){let c=this.rows()??[];this.warehouseLayoutZoneBins.set(c),this.originalWarehouseLayoutZoneBins.set(c)}sortData(c){let a=this.originalWarehouseLayoutZoneBins().slice();if(!c.active||c.direction===""){this.warehouseLayoutZoneBins.set(this.originalWarehouseLayoutZoneBins());return}this.warehouseLayoutZoneBins.set(a.sort((l,s)=>{let m=c.direction==="asc";return this.compare(this.sortValue(l,c.active),this.sortValue(s,c.active),m)}))}sortValue(c,a){switch(a){case"Outlet":return c.OutletName||c.OutletID;case"Zone":return c.ZoneName??"";case"Bin":return c.ZoneBinCode??"";case"Path":return c.Code;default:return""}}compare(c,a,l){return c===a?0:(c<a?-1:1)*(l?1:-1)}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav-warehouse"]],inputs:{rows:[1,"rows"]},standalone:!1,features:[Wr],decls:18,vars:0,consts:[[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light"],[1,"table-secondary"],["mat-sort-header","Outlet",1,"border-end",2,"width","250px"],["mat-sort-header","Zone",1,"border-end"],["mat-sort-header","Bin",1,"border-end"],["mat-sort-header","Path"],[1,"border-end",2,"vertical-align","middle"],[1,"warehouse-outlet-plan","text-muted"],["routerLink","/menu/Warehouses/Warehouse/Bin/Info","target","_blank",3,"queryParams"],[2,"vertical-align","middle"]],template:function(a,l){a&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4),de("matSortChange",function(m){return l.sortData(m)}),d(5,"thead",5)(6,"tr",6)(7,"th",7),v(8," Outlet "),p(),d(9,"th",8),v(10,"Zone"),p(),d(11,"th",9),v(12,"Bin"),p(),d(13,"th",10),v(14,"Path"),p()()(),d(15,"tbody"),Jt(16,iI,13,8,"tr",null,tI),p()()()()()()),a&2&&(f(16),Kt(l.warehouseLayoutZoneBins()))},dependencies:[li,S1,I1],styles:[".warehouse-outlet-plan[_ngcontent-%COMP%]{font-size:.85rem}"],changeDetection:0})};var aI=o=>({"bg-gradient-warning":o});function rI(o,c){o&1&&(G(0,"i",13),d(1,"span",14),v(2,"Point"),p())}function oI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,rI,3,0,"ng-template",3),d(2,"div",5)(3,"div",6)(4,"label",7),v(5,"Point"),p(),G(6,"input",8),p(),d(7,"div",6)(8,"label",9),v(9,"Expiration Day(s)"),p(),G(10,"input",10),p(),d(11,"div",6)(12,"label",11),v(13,"Expiration Month(s)"),p(),G(14,"input",12),p()()()),o&2){let a,l,s,m=x();f(6),M("ngModel",(a=m.data())==null||a.Data.VariantPoint==null?null:a.Data.VariantPoint.Point),f(4),M("ngModel",(l=m.data())==null||l.Data.VariantPoint==null?null:l.Data.VariantPoint.ExpiredDay),f(4),M("ngModel",(s=m.data())==null||s.Data.VariantPoint==null?null:s.Data.VariantPoint.ExpiredMonth)}}function lI(o,c){o&1&&(G(0,"i",13),d(1,"span",14),v(2,"Inventory"),p())}function sI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,lI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-inventory",4),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())}}function cI(o,c){o&1&&(G(0,"i",16),d(1,"span",14),v(2,"Warehouse"),p())}function dI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,cI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-warehouse",15),p()),o&2){let a=x();f(2),M("rows",a.warehouseLayoutZoneBins())}}function pI(o,c){o&1&&(G(0,"i",18),d(1,"span",14),v(2,"Outlet Group"),p())}function mI(o,c){o&1&&(G(0,"i",20),d(1,"span",14),v(2,"Days Of"),p())}function fI(o,c){if(o&1&&G(0,"app-info-variant-mav-forecast",4),o&2){let a=x(3);M("variantInfoModel",a.data())}}function uI(o,c){o&1&&(d(0,"mat-tab"),_i(1,mI,3,0,"ng-template",3)(2,fI,1,1,"ng-template",19),p())}function vI(o,c){if(o&1&&(G(0,"i",21),d(1,"span",14),v(2),p()),o&2){x(2);let a=Qs(4);f(2),Ae(a?"Serial":"Batch Number")}}function gI(o,c){if(o&1&&G(0,"app-info-variant-nav-serial",22),o&2){let a,l=x(3);M("variantId",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function bI(o,c){o&1&&(d(0,"mat-tab"),_i(1,vI,3,1,"ng-template",3)(2,gI,1,1,"ng-template",19),p())}function hI(o,c){o&1&&(G(0,"i",24),d(1,"span",14),v(2,"Component"),p())}function xI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,hI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-component",23),p()),o&2){let a=x(2);f(2),M("composites",a.composites())("currencies",a.currencies())}}function _I(o,c){o&1&&(G(0,"i",25),d(1,"span",14),v(2,"Outlet Price"),p())}function CI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,_I,3,0,"ng-template",3),G(2,"POS-info-variant-nav-outlet-price",4),p()),o&2){let a=x(2);f(2),M("variantInfoModel",a.data())}}function yI(o,c){o&1&&(G(0,"i",27),d(1,"span",14),v(2,"Pricebook"),p())}function wI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,yI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-pricebook",26),p()),o&2){let a=x(2);f(2),M("pricebooks",a.pricebooks())}}function AI(o,c){o&1&&(G(0,"i",29),d(1,"span",14),v(2,"Promotion"),p())}function SI(o,c){if(o&1&&(d(0,"mat-tab",17),_i(1,AI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-promotion",28),p()),o&2){let a=x(2);M("labelClass",ot(3,aI,a.hasHigherPromotionPrice)),f(2),M("promotions",a.promotions())("variant",a.variant())}}function II(o,c){o&1&&(G(0,"i",30),d(1,"span",14),v(2,"Purchase"),p())}function kI(o,c){o&1&&(d(0,"mat-tab"),_i(1,II,3,0,"ng-template",3),G(2,"POS-info-variant-nav-purchase"),p())}function DI(o,c){o&1&&(G(0,"i",32),d(1,"span",14),v(2,"Description"),p())}function MI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,DI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-description",31),p()),o&2){let a=x(2);f(2),M("variant",a.variant())}}function EI(o,c){o&1&&(G(0,"i",34),d(1,"span",14),v(2,"Commission"),p())}function TI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,EI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-commision",33),p()),o&2){let a=x(2);f(2),M("variantInfoModel",a.data())("role",a.roleService==null||a.roleService.product==null?null:a.roleService.product.CommissionView)}}function PI(o,c){o&1&&(G(0,"i",36),d(1,"span",14),v(2,"Dependency Of"),p())}function BI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,PI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-dependency-of",35),p()),o&2){let a=x(2);f(2),M("dependencyOf",a.dependencyOf())}}function NI(o,c){o&1&&(G(0,"i",13),d(1,"span",14),v(2,"Inventory"),p())}function FI(o,c){o&1&&(G(0,"i",16),d(1,"span",14),v(2,"Warehouse"),p())}function VI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,FI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-warehouse",15),p()),o&2){let a=x(2);f(2),M("rows",a.warehouseLayoutZoneBins())}}function RI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,pI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-group-inventory",4),p(),k(3,uI,3,0,"mat-tab"),Us(4),k(5,bI,3,0,"mat-tab"),k(6,xI,3,2,"mat-tab"),k(7,CI,3,1,"mat-tab"),k(8,wI,3,1,"mat-tab"),k(9,SI,3,5,"mat-tab",17),k(10,kI,3,0,"mat-tab"),k(11,MI,3,1,"mat-tab"),k(12,TI,3,2,"mat-tab"),k(13,BI,3,1,"mat-tab"),d(14,"mat-tab"),_i(15,NI,3,0,"ng-template",3),G(16,"POS-info-variant-nav-inventory",4),p(),k(17,VI,3,1,"mat-tab")),o&2){let a,l,s,m,h,_,w,A=x();f(2),M("variantInfoModel",A.data()),f(),D(!(A.roleService==null||A.roleService.inventory==null)&&A.roleService.inventory.View?3:-1);let I=((a=A.data())==null||a.Data==null?null:a.Data.Variant.TypeID)==A.variantType.BatchNumber;f();let P=sc(((l=A.data())==null||l.Data==null?null:l.Data.Variant.TypeID)==A.variantType.Serialized);f(),D(P||I?5:-1),f(),D(((s=A.composites())==null?null:s.length)>0?6:-1),f(),D(((m=A.outletPrices())==null?null:m.length)>0?7:-1),f(),D(A.pricebooks().length!==0&&(!(A.roleService==null||A.roleService.promotion==null)&&A.roleService.promotion.Pricebook)&&(!(A.roleService==null||A.roleService.promotion==null)&&A.roleService.promotion.View)?8:-1),f(),D(A.promotions().length!==0&&(!(A.roleService==null||A.roleService.promotion==null)&&A.roleService.promotion.View)?9:-1),f(),D(!(A.roleService==null||A.roleService.product==null)&&A.roleService.product.Expense&&((h=A.variant())==null?null:h.UnitExpense)!==0?10:-1),f(),D((_=A.variant())!=null&&_.Description?11:-1),f(),D(((w=A.variant())==null?null:w.SalesCommission)!=0||A.commisions().length!==0&&(!(A.roleService==null||A.roleService.product==null)&&A.roleService.product.CommissionView)?12:-1),f(),D(A.dependencyOf().length>0?13:-1),f(3),M("variantInfoModel",A.data()),f(),D(A.warehouseLayoutZoneBins().length?17:-1)}}function OI(o,c){o&1&&(G(0,"i",38),d(1,"span",14),v(2,"Composite Inventory"),p())}function UI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,OI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-composite-inventory",37),p()),o&2){let a,l=x();f(2),M("totalCompositeInventory",l.totalCompositeInventory())("compositeInventories",l.compositeInventories())("variantID",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function QI(o,c){o&1&&(G(0,"i",39),d(1,"span",14),v(2,"History"),p())}function jI(o,c){if(o&1&&G(0,"POS-info-variant-nav-history",22),o&2){let a,l=x(2);M("variantId",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function LI(o,c){o&1&&(d(0,"mat-tab"),_i(1,QI,3,0,"ng-template",3)(2,jI,1,1,"ng-template",19),p())}function HI(o,c){o&1&&(G(0,"i",18),d(1,"span",14),v(2,"Outlet Group"),p())}function qI(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,HI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-group-inventory",4),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())}}function GI(o,c){o&1&&(G(0,"i",20),d(1,"span",14),v(2,"Days Of"),p())}function zI(o,c){if(o&1&&G(0,"app-info-variant-mav-forecast",4),o&2){let a=x(2);M("variantInfoModel",a.data())}}function YI(o,c){o&1&&(d(0,"mat-tab"),_i(1,GI,3,0,"ng-template",3)(2,zI,1,1,"ng-template",19),p())}function WI(o,c){if(o&1&&(G(0,"i",21),d(1,"span",14),v(2),p()),o&2){x(2);let a=Qs(11);f(2),Ae(a?"Serial":"Batch Number")}}function JI(o,c){if(o&1&&G(0,"app-info-variant-nav-serial",22),o&2){let a,l=x(2);M("variantId",(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID)}}function KI(o,c){o&1&&(d(0,"mat-tab"),_i(1,WI,3,1,"ng-template",3)(2,JI,1,1,"ng-template",19),p())}function XI(o,c){o&1&&(G(0,"i",24),d(1,"span",14),v(2,"Component"),p())}function $I(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,XI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-component",23),p()),o&2){let a=x();f(2),M("composites",a.composites())("currencies",a.currencies())}}function ZI(o,c){o&1&&(G(0,"i",25),d(1,"span",14),v(2,"Outlet Price"),p())}function ek(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,ZI,3,0,"ng-template",3),G(2,"POS-info-variant-nav-outlet-price",4),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())}}function tk(o,c){o&1&&(G(0,"i",27),d(1,"span",14),v(2,"Pricebook"),p())}function ik(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,tk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-pricebook",26),p()),o&2){let a=x();f(2),M("pricebooks",a.pricebooks())}}function nk(o,c){o&1&&(G(0,"i",29),d(1,"span",14),v(2,"Promotion"),p())}function ak(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,nk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-promotion",40),p()),o&2){let a=x();f(2),M("promotions",a.promotions())}}function rk(o,c){o&1&&(G(0,"i",30),d(1,"span",14),v(2,"Purchase"),p())}function ok(o,c){o&1&&(d(0,"mat-tab"),_i(1,rk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-purchase"),p())}function lk(o,c){o&1&&(G(0,"i",32),d(1,"span",14),v(2,"Description"),p())}function sk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,lk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-description",31),p()),o&2){let a=x();f(2),M("variant",a.variant())}}function ck(o,c){o&1&&(G(0,"i",34),d(1,"span",14),v(2,"Commission"),p())}function dk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,ck,3,0,"ng-template",3),G(2,"POS-info-variant-nav-commision",33),p()),o&2){let a=x();f(2),M("variantInfoModel",a.data())("role",a.roleService==null||a.roleService.product==null?null:a.roleService.product.CommissionView)}}function pk(o,c){o&1&&(G(0,"i",36),d(1,"span",14),v(2,"Dependency Of"),p())}function mk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,pk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-dependency-of",35),p()),o&2){let a=x();f(2),M("dependencyOf",a.dependencyOf())}}function fk(o,c){o&1&&(G(0,"i",41),d(1,"span",14),v(2,"Advanced"),p())}function uk(o,c){o&1&&(G(0,"i",43),d(1,"span",14),v(2," Multi Unit "),p())}function vk(o,c){if(o&1&&(d(0,"mat-tab"),_i(1,uk,3,0,"ng-template",3),G(2,"POS-info-variant-nav-multi-unit",42),p()),o&2){let a,l=x();f(2),M("variantInfoModel",l.data())("variantType",(a=l.variant())==null?null:a.TypeID)}}var Yp=class o{constructor(c){this.roleService=c;this.outletPrices.set([]),this.pricebooks.set([]),this.commisions.set([]),this.compositeInventories.set([])}roleService;data=Ci();outletPrices=Qe([]);pricebooks=Qe([]);commisions=Qe([]);totalCompositeInventory=Qe(void 0);promotions=Qe([]);compositeInventories=Qe([]);dependencyOf=Qe([]);warehouseLayoutZoneBins=Qe([]);composites=Qe([]);currencies=Qe([]);variant=Qe(new tf);variantParent=Qe(new nf);variantType=g1;hasHigherPromotionPrice=!1;ngOnInit(){this.evaluatePromotionPrice()}ngAfterViewInit(){let c=document.querySelector(".inventory-nav-tab .nav-link"),a=document.querySelector(".inventory-content.tab-content .tab-pane");c&&c.classList?.add("active"),a&&(a.classList?.add("show"),a.classList?.add("active"))}ngOnChanges(){if(this.data()?.Data){this.outletPrices.set(this.data()?.Data.OutletPrice||[]),this.commisions.set(this.data()?.Data.Commission||[]),this.pricebooks.set(this.data()?.Data.Pricebook||[]),this.promotions.set(this.data()?.Data.Promotion||[]),this.compositeInventories.set(this.data()?.Data.CompositeInventory||[]),this.dependencyOf.set(this.data()?.Data.DependencyOf||[]),this.warehouseLayoutZoneBins.set(this.flattenWarehouseLayoutZoneBins()),this.composites.set(this.data()?.Data.Composites||[]),this.variant.set(this.data()?.Data.Variant||new tf),this.variantParent.set(this.data()?.Data.VariantParent||new nf),this.currencies.set(this.data()?.Data.Currencies||[]),this.totalCompositeInventory.set(this.data()?.Data.TotalCompositeInventory);let c=this.data()?.Data.EntityStockOutlet.map(a=>a.PickPack)}}flattenWarehouseLayoutZoneBins(){return(this.data()?.Data?.WarehouseLayouts??[]).flatMap(c=>(c.WarehouseLayoutZoneBins??[]).map(a=>({ID:a.ID,OutletID:c.OutletId,OutletName:c.OutletName,WarehouseLayoutPlanName:c.WarehouseLayoutPlanName,Code:a.Code,ZoneBinCode:a.ZoneBinCode,ZoneName:a.ZoneName})))}get hasAnyHistoryTab(){return this.roleService?.report?.View||this.roleService?.adjustment?.View||this.roleService?.logistic?.View||this.roleService?.order?.View}evaluatePromotionPrice(){let c=this.data()?.Data.Variant.UnitPrice||0;this.hasHigherPromotionPrice=this.promotions()?.some(a=>a.UnitPrice>c)}static \u0275fac=function(a){return new(a||o)(se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-nav"]],inputs:{data:[1,"data"]},standalone:!1,features:[Wr],decls:25,vars:21,consts:[[1,"card","border-top-0"],[1,"card-body","pt-2"],[1,"variant-info-tab",3,"mat-stretch-tabs"],["mat-tab-label",""],[3,"variantInfoModel"],[1,"row","mt-3",2,"padding","0","width","100%"],[1,"col-4"],["for","inputPoint"],["type","text","id","inputPoint","matTooltipPosition","above","matTooltip","Input Point for this variant","placeholder","Point","autoNum","",1,"form-control","custom",3,"ngModel"],["for","inputDays"],["type","text","id","inputDays","matTooltipPosition","above","matTooltip","Input Expired Days for this variant","placeholder","Day(s)","autoNum","",1,"form-control","custom",3,"ngModel"],["for","inputMonth"],["type","text","id","inputMonth","matTooltipPosition","above","matTooltip","Input Expired Months for this variant","placeholder","Month(s)","autoNum","",1,"form-control","custom",3,"ngModel"],[1,"fa-solid","fa-archive","me-3","pb-1"],[1,"fs-5"],[3,"rows"],[1,"fa-solid","fa-warehouse","me-3","pb-1"],[3,"labelClass"],[1,"fa-solid","fa-map-marker-alt","me-3","pb-1"],["matTabContent",""],[1,"fa-solid","fa-hourglass-half","me-3","pb-1"],[1,"fa-solid","fa-barcode","me-3","pb-1"],[3,"variantId"],[3,"composites","currencies"],[1,"fa-regular","fa-sitemap","me-3","pb-1"],[1,"fa-solid","fa-dollar","me-3"],[3,"pricebooks"],[1,"fa-solid","fa-tag","me-3","pb-1"],[3,"promotions","variant"],[1,"fa-solid","fa-bullhorn","me-3","pb-1"],[1,"fa-regular","fa-cart-shopping","me-3","pb-1"],[3,"variant"],[1,"fa-solid","fa-text","me-3","pb-1"],[3,"variantInfoModel","role"],[1,"fa-solid","fa-money-bill-1-wave","me-3","pb-1"],[3,"dependencyOf"],[1,"fa-solid","fa-link","me-3","pb-1"],[3,"totalCompositeInventory","compositeInventories","variantID"],[1,"fa-solid","fa-boxes-stacked","me-3","pb-1"],[1,"fa-solid","fa-clock-rotate-left","me-3","pb-1"],[3,"promotions"],[1,"fa-solid","fa-gear","me-3","pb-1"],[3,"variantInfoModel","variantType"],[1,"fa-regular","fa-landmark","me-3","pb-1"]],template:function(a,l){if(a&1&&(d(0,"div",0)(1,"div",1)(2,"mat-tab-group",2),k(3,oI,15,3,"mat-tab"),k(4,sI,3,1,"mat-tab"),k(5,dI,3,1,"mat-tab"),k(6,RI,18,14),k(7,UI,3,3,"mat-tab"),k(8,LI,3,0,"mat-tab"),k(9,qI,3,1,"mat-tab"),k(10,YI,3,0,"mat-tab"),Us(11),k(12,KI,3,0,"mat-tab"),k(13,$I,3,2,"mat-tab"),k(14,ek,3,1,"mat-tab"),k(15,ik,3,1,"mat-tab"),k(16,ak,3,1,"mat-tab"),k(17,ok,3,0,"mat-tab"),k(18,sk,3,1,"mat-tab"),k(19,dk,3,2,"mat-tab"),k(20,mk,3,1,"mat-tab"),d(21,"mat-tab"),_i(22,fk,3,0,"ng-template",3),G(23,"POS-info-variant-nav-advanced",4),p(),k(24,vk,3,2,"mat-tab"),p()()()),a&2){let s,m,h,_,w,A,I,P,T,B,L,N,Y;f(2),M("mat-stretch-tabs",!1);let ee=((s=l.data())==null||s.Data==null||s.Data.Variant==null?null:s.Data.Variant.TypeID)==l.variantType.PrepaidPackage||((s=l.data())==null||s.Data==null||s.Data.Variant==null?null:s.Data.Variant.TypeID)==l.variantType.PrepaidPoint;f(),D(ee?3:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View&&((m=l.data())==null?null:m.Data.Variant.TypeID)!==l.variantType.Composite?4:-1),f(),D(l.warehouseLayoutZoneBins().length?5:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View&&((h=l.data())!=null&&h.Data.VariantParent)&&((h=l.data())==null?null:h.Data.Variant.TypeID)===l.variantType.Composite?6:-1),f(),D(((_=l.data())==null?null:_.Data.Variant.TypeID)===l.variantType.Composite?7:-1),f(),D(l.hasAnyHistoryTab?8:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View&&((w=l.data())==null?null:w.Data.Variant.TypeID)!==l.variantType.Composite?9:-1),f(),D(!(l.roleService==null||l.roleService.inventory==null)&&l.roleService.inventory.View?10:-1);let ie=((A=l.data())==null||A.Data==null?null:A.Data.Variant.TypeID)==l.variantType.BatchNumber;f();let K=sc(((I=l.data())==null||I.Data==null?null:I.Data.Variant.TypeID)==l.variantType.Serialized);f(),D(K||ie?12:-1),f(),D(((P=l.composites())==null?null:P.length)>0?13:-1),f(),D(((T=l.outletPrices())==null?null:T.length)>0&&(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Price)?14:-1),f(),D(l.pricebooks().length!==0&&(!(l.roleService==null||l.roleService.promotion==null)&&l.roleService.promotion.Pricebook)&&(!(l.roleService==null||l.roleService.promotion==null)&&l.roleService.promotion.View)?15:-1),f(),D(l.promotions().length!==0&&(!(l.roleService==null||l.roleService.promotion==null)&&l.roleService.promotion.View)?16:-1),f(),D(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.Expense&&((B=l.variant())==null?null:B.UnitExpense)!==0?17:-1),f(),D((L=l.variant())!=null&&L.Description?18:-1),f(),D(((N=l.variant())==null?null:N.SalesCommission)!=0||l.commisions().length!==0&&(!(l.roleService==null||l.roleService.product==null)&&l.roleService.product.CommissionView)?19:-1),f(),D(l.dependencyOf().length>0?20:-1),f(3),M("variantInfoModel",l.data()),f(),D(((Y=l.variant())==null?null:Y.TypeID)==l.variantType.MultipleUOM||((Y=l.variant())==null?null:Y.TypeID)==l.variantType.BaseUnit?24:-1)}},dependencies:[Ei,Cn,Vi,Ri,Pv,U2,Q2,j2,_o,ws,Tp,Pp,Bp,Np,Fp,Vp,Rp,Op,Up,Qp,jp,Lp,Hp,qp,Gp,zp],styles:["mat-tab-group.variant-info-tab mat-tab-header{border-bottom:1px solid #e0e0e0}",".form-control.custom[_ngcontent-%COMP%]{min-height:36px;line-height:1.5;cursor:default;background-color:#fff}.expand-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.expand-icon.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.form-control.custom[_ngcontent-%COMP%]:not(.hyperlink-pointer):hover{cursor:default!important}a[_ngcontent-%COMP%] > input.form-control.custom[_ngcontent-%COMP%], #inputParentProduct[_ngcontent-%COMP%]{cursor:pointer}a.hyperlink-pointer[_ngcontent-%COMP%]{color:#075e90!important;cursor:pointer!important}.input-group-text[_ngcontent-%COMP%]{height:100%}.form-control.custom.addons-form-control[_ngcontent-%COMP%]{width:50px;border-top-left-radius:0;border-bottom-left-radius:0}.form-control.custom.no-border-right[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-control.custom[_ngcontent-%COMP%]{border-radius:4px;padding:10px 12px;margin-top:6px}.form-control.custom.has-suffix[_ngcontent-%COMP%]{padding-right:44px}"],changeDetection:0})};var bk=()=>["/menu/Products/Log/Variant_History"],d4=o=>({VariantID:o}),hk=()=>["/menu/Products/Catalog/Variants/Inventory_Cost_History"],xk=()=>["/menu/Products/Catalog/Variants/Form"],_k=o=>({ID:o});function Ck(o,c){if(o&1&&(d(0,"a",16),G(1,"i",17),v(2,"\xA0\xA0Inventory Cost"),p()),o&2){let a,l=x(3);M("routerLink",ft(2,hk))("queryParams",ot(3,d4,(a=l.data())==null||a.Data==null||a.Data.Variant==null?null:a.Data.Variant.ID))}}function yk(o,c){if(o&1&&(d(0,"div",1),k(1,Ck,3,5,"a",16),p()),o&2){let a=x(2);f(),D(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Edit?1:-1)}}function wk(o,c){if(o&1&&(d(0,"a",3),G(1,"i",18),v(2,"\xA0\xA0Edit"),p()),o&2){let a,l=x(2);M("routerLink",ft(2,xk))("queryParams",ot(3,_k,(a=l.data())==null?null:a.Data.Variant.ID))}}function Ak(o,c){o&1&&G(0,"button",4)}function Sk(o,c){if(o&1){let a=Se();d(0,"a",19),de("click",function(){U(a);let s=x(2);return Q(s.deleteVariantInfo())}),G(1,"i",20),v(2,"\xA0\xA0Delete"),p()}}function Ik(o,c){if(o&1){let a=Se();d(0,"mainpanel-cmp",0)(1,"actions"),k(2,yk,2,1,"div",1),d(3,"div",2),k(4,wk,3,5,"a",3),k(5,Ak,1,0,"button",4),d(6,"ul",5)(7,"li")(8,"a",6),de("click",function(){U(a);let s=x();return Q(s.detachToNewProduct(s.data().Data.Variant.ID))}),v(9,"Detach to New Product "),p()()()(),k(10,Sk,3,0,"a",7),p(),d(11,"content")(12,"div",8)(13,"POS-personal-information",9),de("imageUploadSuccess",function(){U(a);let s=x();return Q(s.reloadVariantInfo())}),p(),G(14,"POS-cost-and-price",10),d(15,"div",11)(16,"div",12),G(17,"POS-info-variant-nav",13),p()(),d(18,"div",14)(19,"div",12),G(20,"POS-timeline",15),p()()()()()}if(o&2){let a,l,s,m=x();M("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",m.menuData()),f(2),D(!((a=m.data())==null||a.Config==null)&&a.Config.IsFIFO?2:-1),f(2),D(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit?4:-1),f(),D(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Edit?5:-1),f(5),D(!(m.roleService==null||m.roleService.product==null)&&m.roleService.product.Delete?10:-1),f(3),M("data",m.data()),f(),M("data",m.data())("outletPriceVisible",m.outletPriceVisible())("priceFormExpanded",m.priceFormExpanded()),f(3),M("data",m.data())("role",m.data()),f(3),M("viewLink",ft(17,bk))("queryParams",ot(18,d4,(l=m.data())==null?null:l.Data.Variant.ID))("items",m.timelineData)("created",((s=m.data())==null||s.Data==null||s.Data.DocumentInfo==null?null:s.Data.DocumentInfo.Created)??null)}}var kk={Unknown:"Unknown",UpdateEntry:"Variant Updated",Buy:"Cost Changed",Manufacture:"Cost Changed",CSV:"CSV Import",VoidInvoice:"Void Invoice",LandedCost:"Landed Cost Changed"},c4=BiggerPicture({target:document.body}),Wp=class o extends e1{constructor(a,l,s,m,h,_,w){super(a,l,"catalog/variant/GetVariantInfoModelById",s);this.httpService=l;this.activatedRoute=s;this.router=m;this.toaster=h;this.title=_;this.roleService=w;this.destroy$=new ps,this.router.routeReuseStrategy.shouldReuseRoute=function(){return!1}}httpService;activatedRoute;router;toaster;title;roleService;AutoGenerateCode=Qe("");destroy$;outletPriceVisible=Qe(!1);isPrepaidPoint=Qe(!1);isPrepaidPackage=Qe(!1);IsPurchaseRoleHistory=Qe(!1);paymentType=mf;maskingFields;priceFormExpanded=Qe(!1);timelineData=[];timelineLoading=!1;cdr=dn(k2);initRoles(){this.outletPriceVisible.set(this.roleService.product.Cost),this.IsPurchaseRoleHistory.set(this.roleService.buy.Create&&this.roleService.report.View),this.isPrepaidPoint.set(this.data()?.Data?.Variant?.TypeID==13),this.isPrepaidPackage.set(this.data()?.Data?.Variant?.TypeID==10)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}reloadVariantInfo(){let a=this.activatedRoute.snapshot.queryParams;this.httpService.post("/api/catalog/variant/GetVariantInfoModelById",a).subscribe(l=>{this.data.set(l),this.postBindForm(l)})}formattedDescription(a){return a.replace(/\n/g,"<br>")}postBindForm(a){this.menuData().H=a.Data.PageTitle;let l=this.title.getTitle().split("|")[0],s=this.data()?.Data?.Variant?.Name;this.title.setTitle(`${l}| ${s}`),this.maskingFields=Qi.generateMaskingField(a.Config?.MaskFields),this.initRoles(),this.data().Data.Variant.Description=this.formattedDescription(a.Data.Variant.Description),this.fetchVariantTimeline()}fetchVariantTimeline(){let a=this.data()?.Data?.Variant?.ID;a&&(this.timelineLoading=!0,this.httpService.get(`/API/catalog/variant/Timeline/${a}`).subscribe({next:l=>{this.timelineData=Vd(l?.Data,kk),this.timelineLoading=!1,this.cdr.markForCheck()},error:()=>{this.timelineData=[],this.timelineLoading=!1,this.cdr.markForCheck()}}))}deleteVariantInfo(){confirm("Are you sure you want to delete this record?")&&(this.data().Form={ID:this.data().Data.Variant.ID},this.onSubmit("catalog/variant/DeleteVariantInfo"))}onSubmitSuccess(){this.router.navigate(["/menu/Products/Catalog/Variants"]),this.toaster.success("Success Delete Variant",Zi.Success)}detachToNewProduct(a){this.httpService.post("/api/catalog/variant/DetachToNewProduct",{ID:a}).subscribe(()=>{this.toaster.success("Success detach to new product","Success")})}get variantName(){if(this.data&&this.data().Data&&this.data().Data.Product){let l=`${this.data().Data.Product.Display}`;return{name:l.length>40?`${l.slice(0,40)}...`:l,tooltip:l.length>40?l:""}}return""}openGalery(a){a.preventDefault();let l=a.target.parentElement,s=l?.attributes?.getNamedItem("href")?.value;if(s?.startsWith("data:image/svg+xml")){let m=new Blob([decodeURIComponent(s?.split(",")[1])],{type:"image/svg+xml"}),h=URL.createObjectURL(m);c4.open({items:[{img:h,height:300,width:300}],el:l,intro:"fadeup",noPinch:_=>_.clientWidth<800,maxZoom:1}),setTimeout(()=>URL.revokeObjectURL(h),5e3)}else c4.open({items:[s],el:l})}onInputChange(a,l){try{let s=this.data()?.Data?.Variant;if(!s)return;if(["UnitCost","UnitPrice","Weight","OrderPrice","UnitPriceMinimum","MaxOrderPrice"].includes(a)){let h=parseFloat((l||"").toString().replace(/,/g,""));s[a]=isNaN(h)?0:h}else a==="VariantType"?s.VariantType=l:a==="Taxable"?s.Taxable=l==="Yes"||l===!0:a==="LoyaltyPoint"?s.LoyaltyPoint=l==="Yes"||l===!0:a==="Discontinued"?s.Discontinued=l==="Yes"||l===!0:s[a]=l;this.cdr.markForCheck()}catch(s){console.error("onInputChange error",s)}}get showCostCurrencySymbol(){let a=this.data().Data.Currencies.find(l=>l.Primary===!0);return this.data().Data.Currencies.length>1&&a.ID!==this.data().Data.Variant.CostCurrencyID}get showPriceCurrencySymbol(){let a=this.data().Data.Currencies.find(l=>l.Primary===!0);return this.data().Data.Currencies.length>1&&a.ID!==this.data().Data.Variant.PriceCurrencyID}static \u0275fac=function(l){return new(l||o)(se(en),se(ki),se(Jn),se(ir),se(zi),se(dc),se(yi))};static \u0275cmp=nt({type:o,selectors:[["POS-info-variant-v2"]],features:[$i],decls:1,vars:1,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData"],[1,"btn-group"],[1,"btn-group","ms-5"],[1,"btn","btn-outline-secondary","border-end-0",3,"routerLink","queryParams"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],["role","button",1,"dropdown-item",3,"click"],["role","button",1,"btn","btn-outline-secondary","ms-3"],[1,"container-fluid","bg-light-gray","pt-8","m-0","d-flex","flex-column","gap-6"],[3,"imageUploadSuccess","data"],[3,"data","outletPriceVisible","priceFormExpanded"],[1,"row","mb-2","mt-4"],[1,"col-12"],[3,"data","role"],[1,"row"],["variant","compact",3,"viewLink","queryParams","items","created"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-clock-rotate-left"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary","ms-3",3,"click"],[1,"fa","fa-trash"]],template:function(l,s){if(l&1&&k(0,Ik,21,20,"mainpanel-cmp",0),l&2){let m;D((m=s.data())!=null&&m.Data?0:-1)}},dependencies:[hc,tn,bc,li,nr,tr,Cp,yp,Dp,Yp,wc],encapsulation:2,changeDetection:0})};var Dk=[{path:"Catalog/Categories",component:$d},{path:"Catalog/Categories/Form",component:Zd},{path:"Catalog/Categories/Info",component:ep},{path:"Catalog/Products",component:Bd},{path:"Catalog/Products/Form",loadComponent(){return import("./chunk-3X4LLCCP.js").then(o=>o.ProductFormComponent)}},{path:"Catalog/Products/Info",component:Qd},{path:"Catalog/Products/Import",component:fp},{path:"Catalog/Products/Inventory",component:rp},{path:"Catalog/Variants",component:jd},{path:"Catalog/Variants/Form",loadComponent:()=>import("./chunk-EE3YE455.js").then(o=>o.FormVariantV2Component)},{path:"Catalog/Variants/Info",component:Wp},{path:"Catalog/Variants/Log",component:ip},{path:"Catalog/Variants/Serial_Form",component:ap},{path:"Catalog/Serial",component:op},{path:"Catalog/Serial/Import",loadComponent:()=>import("./chunk-OKWYG2K5.js").then(o=>o.ImportSerialV2Component)},{path:"Catalog/Serial/Import/V1",component:pp},{path:"Catalog/Serial/Form",component:lp},{path:"Catalog/Serial/Info",component:sp},{path:"Log/Variant_History",component:Hd},{path:"Log/Product_History",loadComponent:()=>import("./chunk-2UZOSMPU.js").then(o=>o.ProductUpdateHistoryComponent)},{path:"Log/Product_Import_Log",component:up},{path:"Price_Editor/Custom_Outlet_Price",component:qd},{path:"Setup/Brand",component:Gd},{path:"Setup/Brand/Brand_Info",loadComponent:()=>import("./chunk-5IH2IOBL.js").then(o=>o.BrandInfoComponent)},{path:"Setup/Brand/Brand_Form",component:Jd},{path:"Setup/Measurement",component:zd},{path:"Setup/Measurement/Form",component:Kd},{path:"Setup/Tags",component:Yd},{path:"Setup/Tags/Tags_Form",component:p0},{path:"Setup/Tags/Info",component:vp},{path:"Setup/Tags/Form",component:p0},{path:"Setup/UOM",component:Wd},{path:"Setup/UOM/Form",component:Xd},{path:"",redirectTo:"Catalog/Products",pathMatch:"full"}],Qc=class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=lc({type:o});static \u0275inj=ac({imports:[v1.forChild(Dk),v1]})};var p4=class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=lc({type:o});static \u0275inj=ac({providers:[kv],imports:[gs,cd,id,yd,Id,z2,Ac,nr,hc,tr,bc,Qc,Xo,dd,mc,P2,N2,V2,R2,O2,md,F2,L2,H2,q2,$o,fc,B2,Xr,Co,fd,K2,sd,il,fc,bd,Cc,nd,Kr,hd,vd,_c,gd,td,k1,Zo,pd,yc,ed,ad,$2,Ic,kc,ws,Sd,Ml,tl,od,kd,xd,ud,Sc,rd,Dd,Ag,xc,wc]})};export{p4 as ProductModule};
|