marketplacepos 5.46.2 → 5.46.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-WAKKUK6E.js → chunk-25N6ECN7.js} +1 -1
- package/Marketplace/chunk-2REDCSBO.js +1 -0
- package/Marketplace/{chunk-BAXQ2L7B.js → chunk-2WHJU6CS.js} +1 -1
- package/Marketplace/chunk-3NCIMELL.js +5 -0
- package/Marketplace/{chunk-AMYZMAYI.js → chunk-4PL4XC3C.js} +1 -1
- package/Marketplace/{chunk-YXBR6VYQ.js → chunk-53AH4SKO.js} +1 -1
- package/Marketplace/{chunk-FGFIV3VO.js → chunk-57MSCWQ4.js} +1 -1
- package/Marketplace/chunk-6EMUVAZD.js +1 -0
- package/Marketplace/{chunk-LCZ6SUUA.js → chunk-6GQN3CZ7.js} +1 -1
- package/Marketplace/{chunk-YA3VMYDA.js → chunk-6L24E3SM.js} +1 -1
- package/Marketplace/{chunk-II5QZVLR.js → chunk-764WEWDX.js} +1 -1
- package/Marketplace/{chunk-FYRDNKYT.js → chunk-7NGIEICQ.js} +1 -1
- package/Marketplace/{chunk-XXAV6VNB.js → chunk-ACNBNSCK.js} +1 -1
- package/Marketplace/{chunk-3BALA33G.js → chunk-B3HL4DNT.js} +1 -1
- package/Marketplace/chunk-B3RO2S3D.js +1 -0
- package/Marketplace/{chunk-CGEIIRYF.js → chunk-BPAZ4TES.js} +1 -1
- package/Marketplace/{chunk-QSHR75ZI.js → chunk-BXXJEM76.js} +1 -1
- package/Marketplace/{chunk-3YP6ORBR.js → chunk-C7YK5TDP.js} +1 -1
- package/Marketplace/{chunk-CBAQUD22.js → chunk-CTDSVBZQ.js} +1 -1
- package/Marketplace/{chunk-WAZXTB4X.js → chunk-DGIH7HSJ.js} +1 -1
- package/Marketplace/{chunk-72OHPB5Q.js → chunk-DSAVJZIH.js} +2 -2
- package/Marketplace/{chunk-3434HH7H.js → chunk-E42O4ZCH.js} +1 -1
- package/Marketplace/chunk-EOYO5KJW.js +1 -0
- package/Marketplace/{chunk-CIPLCKUF.js → chunk-EPCXMVX3.js} +1 -1
- package/Marketplace/chunk-ER3SGZ7B.js +1 -0
- package/Marketplace/{chunk-OHSVQSCM.js → chunk-ESDWGP24.js} +1 -1
- package/Marketplace/chunk-GHFADTRR.js +1 -0
- package/Marketplace/{chunk-6RMBCW2O.js → chunk-HAJDTNAW.js} +1 -1
- package/Marketplace/chunk-IJVKHW3C.js +1 -0
- package/Marketplace/chunk-JGKNYWZY.js +1 -0
- package/Marketplace/chunk-JOZJZEGN.js +1 -0
- package/Marketplace/chunk-JUHGMPX2.js +1 -0
- package/Marketplace/{chunk-PLHWGG4D.js → chunk-K5YVT6CU.js} +2 -2
- package/Marketplace/{chunk-PL3Q6PGC.js → chunk-LSSYGFVV.js} +1 -1
- package/Marketplace/{chunk-PE4SWUEZ.js → chunk-M7DDFDPD.js} +1 -1
- package/Marketplace/chunk-MP3G42LL.js +1 -0
- package/Marketplace/chunk-O73TXSTZ.js +1 -0
- package/Marketplace/{chunk-6VZVNRUE.js → chunk-OCJXLFB4.js} +2 -2
- package/Marketplace/chunk-PBHJGJHF.js +1 -0
- package/Marketplace/{chunk-HITTNWB6.js → chunk-PHLSX23M.js} +1 -1
- package/Marketplace/chunk-QOG52KD3.js +1 -0
- package/Marketplace/chunk-QPC5ZTYC.js +1 -0
- package/Marketplace/chunk-QSERFP5U.js +1 -0
- package/Marketplace/chunk-QTTNQJAK.js +1 -0
- package/Marketplace/chunk-RTF4FRXW.js +3 -0
- package/Marketplace/{chunk-UHJEXTOG.js → chunk-RU43F4UK.js} +1 -1
- package/Marketplace/chunk-RXQX7567.js +1 -0
- package/Marketplace/{chunk-LFGPYQCI.js → chunk-SBLG2UP7.js} +1 -1
- package/Marketplace/{chunk-Z67623R4.js → chunk-TG5SFCNG.js} +1 -1
- package/Marketplace/{chunk-CWXOXH6M.js → chunk-THMNZQLX.js} +1 -1
- package/Marketplace/{chunk-NWWYOZ4V.js → chunk-TKV7XWBT.js} +1 -1
- package/Marketplace/{chunk-SZGOLKC6.js → chunk-TYSVSEYQ.js} +1 -1
- package/Marketplace/{chunk-B2WOBUES.js → chunk-UDXV6RW2.js} +1 -1
- package/Marketplace/{chunk-ZLNAFA4X.js → chunk-V33UHV5X.js} +1 -1
- package/Marketplace/{chunk-CBJR2A72.js → chunk-V54LZUEC.js} +1 -1
- package/Marketplace/chunk-VHOREEP5.js +1 -0
- package/Marketplace/chunk-VODHIYRA.js +1 -0
- package/Marketplace/{chunk-OE7TF7SI.js → chunk-W4MTON2T.js} +1 -1
- package/Marketplace/{chunk-3GRC47DP.js → chunk-WBKGEDL6.js} +1 -1
- package/Marketplace/{chunk-HGZ5B6WR.js → chunk-WHBI5II7.js} +1 -1
- package/Marketplace/{chunk-OVPVQS4J.js → chunk-WIMLQM6B.js} +1 -1
- package/Marketplace/{chunk-RJ5D24ZW.js → chunk-WY37QAZ4.js} +1 -1
- package/Marketplace/{chunk-BDKGOINV.js → chunk-XMZNTZ72.js} +1 -1
- package/Marketplace/{chunk-FNU2TKTQ.js → chunk-XSCE2K6J.js} +1 -1
- package/Marketplace/{chunk-77MWKV5I.js → chunk-XSJBP4EN.js} +2 -2
- package/Marketplace/chunk-YIKOIRZU.js +1 -0
- package/Marketplace/{chunk-A57T33JT.js → chunk-ZC7VX6UG.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-CVD4P432.js +1 -0
- package/package.json +1 -1
- package/Marketplace/chunk-45FZJ4W3.js +0 -1
- package/Marketplace/chunk-4DMKVXM7.js +0 -1
- package/Marketplace/chunk-4JQLXONG.js +0 -1
- package/Marketplace/chunk-7AZDAPB7.js +0 -1
- package/Marketplace/chunk-7F74QXF6.js +0 -1
- package/Marketplace/chunk-7VLMA7MW.js +0 -1
- package/Marketplace/chunk-GPX77ZSI.js +0 -1
- package/Marketplace/chunk-GRQD4D2I.js +0 -1
- package/Marketplace/chunk-NDLOPOFD.js +0 -1
- package/Marketplace/chunk-OEAOBG75.js +0 -1
- package/Marketplace/chunk-OHVOVAKD.js +0 -1
- package/Marketplace/chunk-P5YM6T6I.js +0 -1
- package/Marketplace/chunk-PW42BQIY.js +0 -1
- package/Marketplace/chunk-Q2B5GUDO.js +0 -1
- package/Marketplace/chunk-QVP2CM7Y.js +0 -5
- package/Marketplace/chunk-RM2OSYMV.js +0 -1
- package/Marketplace/chunk-TM6DZ3ZF.js +0 -1
- package/Marketplace/chunk-UX3OTI5X.js +0 -1
- package/Marketplace/chunk-V6GFM5AQ.js +0 -1
- package/Marketplace/chunk-WEYKQCVQ.js +0 -1
- package/Marketplace/chunk-WWLC64XZ.js +0 -3
- package/Marketplace/chunk-XPBMYV5W.js +0 -1
- package/Marketplace/chunk-Z3J3CSGS.js +0 -1
- package/Marketplace/main-FUX6VJVF.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-EHBCYQSG.js";import{b as ze}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as Ze}from"./chunk-OHVOVAKD.js";import"./chunk-IITU3NV6.js";import{a as ee}from"./chunk-XHAXYWZ7.js";import{a as Ge,b as Ye,c as Ke,d as J,e as te}from"./chunk-NWWYOZ4V.js";import{a as Qe,b as He}from"./chunk-YTCIQBSO.js";import"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as We}from"./chunk-PE4SWUEZ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as q}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as Ue,b as Be,c as $e}from"./chunk-GHVAGYK3.js";import"./chunk-JVNHFIYT.js";import{a as je}from"./chunk-3YP6ORBR.js";import"./chunk-6RMBCW2O.js";import{i as Te}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-CGOB6Y3X.js";import{b as ve,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as De}from"./chunk-PYXL7UF7.js";import{c as f}from"./chunk-PW42BQIY.js";import{b as Me,c as Ve,d as ke,j as Re,k as Le,l as Ne,m as Ae,n as Oe}from"./chunk-HJXYT6MI.js";import{A as ye,b as Ce,c as ge,h as fe,m as xe,o as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as be,c as Fe}from"./chunk-ERXVXBTU.js";import{r as Pe,s as Ee}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ue,J as he,d as me,g as de,j as $,k as W,m as _e,n as j}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as K,G as Q,Gb as U,Gc as c,Hc as O,Ic as I,Kc as b,Lc as F,Mb as h,Mc as T,Nc as re,Oc as se,Pc as ce,Qc as B,Ra as V,Rc as pe,Sc as M,Yb as m,Z as N,ac as ae,ad as y,bd as k,cd as Z,dc as v,ea as H,ec as z,gc as G,hc as Y,ic as a,jc as l,kc as x,lc as P,mc as E,oc as S,pa as w,pb as A,rb as s,tc as C,uc as r,v as L,xb as D,xc as le,ya as d,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as oe}from"./chunk-66YHNWRR.js";var tt=()=>["/menu/order/download"];function nt(n,p){if(n&1&&(a(0,"li",4)(1,"div"),c(2," The last time you manually download your order is on "),a(3,"span",8),c(4),g(5,"date"),l()(),a(6,"div",9),c(7),l()()),n&2){r();let e=ce(0);s(4),I(" ",k(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function it(n,p){n&1&&(a(0,"li",4),c(1," The last time you manually download your order is on (-) "),l())}var qe=(()=>{class n{constructor(){this.dialogRef=w(Me),this.data=w(Ve),this.modalConfig=new Re,this.inventoryService=w(R),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(L(e=>{let o=e.OrderDownloadLatestOn!=f.MinDate,t=null,i=null;return o&&(t=new Date(e.OrderDownloadLatestOn),i=f.convertToReadableDate(t)),{OrderDownloadLatestOn:t,calculatedDate:i}}),N(1)),this.selectedProducts=V(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-dialog-update-product-info"]],features:[B([R])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(o,t){if(o&1){let i=S();re(0),g(1,"async"),a(2,"modal-material",0),C("onCancel",function(){return d(i),_(t.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),c(6),l(),a(7,"div",3)(8,"ul"),h(9,nt,8,5,"li",4)(10,it,2,0,"li",4),l()()()(),a(11,"div",5)(12,"a",6),C("click",function(){return d(i),_(t.onCancel())}),c(13," Download "),l(),a(14,"button",7),C("click",function(){return d(i),_(t.onUpdate())})("keyup.F2",function(){return d(i),_(t.onUpdate())}),c(15," Update Anyway "),l()()()}if(o&2){let i=se(y(1,4,t.lastDownloadInfo$));s(2),m("config",t.modalConfig),s(4),I("",t.selectedProducts().length," Product(s) will be updated."),s(3),v(i!=null&&i.OrderDownloadLatestOn?9:10),s(3),m("routerLink",pe(7,tt))}},dependencies:[Le,j,$,W,he,ue],encapsulation:2})}}return n})();var ne=n=>[n],ot=n=>({"text-decoration-line-through":n}),at=n=>({"me-10":n}),lt=n=>({"bg-gradient-warning":n}),rt=n=>({cursor:n});function st(n,p){if(n&1){let e=S();a(0,"button",39),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onScanInventory(t))}),x(1,"i",40),c(2,"Refresh "),l()}}function ct(n,p){if(n&1){let e=S();a(0,"div",37)(1,"button",41),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onOpenDialogUpdateStockInfo(t))}),x(2,"i",42),c(3," Update "),l(),x(4,"button",43),a(5,"ul",44)(6,"a",45),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(7,"i",46),a(8,"span"),c(9,"Export"),l()()()()}}function pt(n,p){if(n&1){let e=S();a(0,"button",47),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(1,"i",46),a(2,"span"),c(3,"Export"),l()()}}function mt(n,p){if(n&1&&(a(0,"div"),h(1,st,3,0,"button",36)(2,ct,10,0,"div",37)(3,pt,4,0,"button",38),l()),n&2){let e=p.ngIf,o=r(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),v(o.productService.hasSelectionVariant(e)?2:3)}}function dt(n,p){n&1&&(a(0,"div",48)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function _t(n,p){if(n&1){let e=S();a(0,"th")(1,"input",49),T("ngModelChange",function(t){d(e);let i=r(3);return F(i.checkboxState,t)||(i.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=d(e).ngIf,i=r(3);return _(i.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(3);s(),b("ngModel",e.checkboxState)}}function ut(n,p){if(n&1&&(P(0),h(1,_t,2,1,"th",5),g(2,"async"),E()),n&2){let e=r(2);s(),m("ngIf",y(2,1,e.products$))}}function ht(n,p){n&1&&(a(0,"th",33),c(1," Reserved "),l())}function Ct(n,p){if(n&1){let e=S();a(0,"input",65),T("ngModelChange",function(t){d(e);let i=r(4).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),C("ngModelChange",function(){d(e);let t=r(4).$implicit,i=r(2);return _(i.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(4).$implicit;b("ngModel",e.selected)}}function gt(n,p){if(n&1&&(P(0),a(1,"div",63),h(2,Ct,1,1,"input",64),l(),E()),n&2){let e=r(3).$implicit;s(),m("ngClass",M(2,at,e.Variants.length<=1)),s(),v(e.Variants.length>1?2:-1)}}function ft(n,p){if(n&1){let e=S();a(0,"img",66),C("click",function(t){d(e);let i=r(3).$implicit,u=r(2);return _(u.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;le("src",e==null?null:e.ThumbnailUrl,A)}}function xt(n,p){n&1&&x(0,"img",60)}function St(n,p){if(n&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function yt(n,p){if(n&1&&(a(0,"td",58)(1,"div",14),h(2,gt,3,4,"ng-container",27),a(3,"div"),h(4,ft,1,1,"img",59)(5,xt,1,0,"img",60),l()()(),a(6,"td",61)(7,"span",62),c(8),l(),h(9,St,5,1),l()),n&2){let e=r(2).$implicit,o=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,ne,o.inventoryUpdateRole)),s(2),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),O(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function vt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(3).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(3).$implicit;b("ngModel",e.selected)}}function It(n,p){if(n&1&&h(0,vt,1,1,"input",70),n&2){let e=r(2).$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function wt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(2).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(2).$implicit;b("ngModel",e.selected)}}function bt(n,p){if(n&1&&(P(0),a(1,"td",69),h(2,It,1,1)(3,wt,1,1,"input",70),l(),E()),n&2){let e=r().$implicit;s(2),v((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function Ft(n,p){n&1&&(a(0,"div",71),c(1," Not Found "),l())}function Tt(n,p){if(n&1&&(a(0,"div")(1,"span",72),c(2),g(3,"number"),l(),c(4," => "),a(5,"span",73),c(6),g(7,"number"),l()()),n&2){let e=r().$implicit;s(2),I(" ",y(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),O(y(7,4,e==null?null:e.Inventory))}}function Dt(n,p){if(n&1&&(c(0),g(1,"number")),n&2){let e=r().$implicit;I(" ",y(1,1,e==null?null:e.Inventory)," ")}}function Pt(n,p){if(n&1&&(P(0),a(1,"div",74)(2,"a",75),x(3,"i",76),l()(),E()),n&2){let e=r().$implicit,o=r(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A)}}function Et(n,p){if(n&1){let e=S();a(0,"span",81),C("click",function(){d(e);let t=r(2).$implicit,i=r().$implicit,u=r(2);return _(u.openTableDialog(i,t))}),c(1),g(2,"number"),l()}if(n&2){let e=r(2).$implicit,o=r(3);ae(M(5,rt,o.hasInventoryEdit())),s(),I(" ",y(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Mt(n,p){if(n&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),h(3,Et,3,7,"span",78),g(4,"async"),l(),a(5,"div",74)(6,"a",75),x(7,"i",76),l()(),a(8,"div",74)(9,"span",79),C("click",function(){d(e);let t=r().$implicit,i=r(3);return _(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",80),l()()()()}if(n&2){let e=r().$implicit,o=r(3);m("ngClass",M(5,lt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",y(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function Vt(n,p){if(n&1&&(P(0),a(1,"span",82),c(2),g(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),I(" (",y(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function kt(n,p){n&1&&c(0," - ")}function Rt(n,p){if(n&1&&(P(0),a(1,"td",51),h(2,Vt,4,3,"ng-container",57)(3,kt,1,0,"ng-template",null,1,Z),l(),E()),n&2){let e=K(4),o=r().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Lt(n,p){n&1&&(P(0),c(1," - "),E())}function Nt(n,p){if(n&1&&(a(0,"span",83),g(1,"date"),c(2),g(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",k(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",k(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function At(n,p){if(n&1&&(a(0,"tr"),h(1,yt,10,8),a(2,"td",50),c(3),l(),a(4,"td",51)(5,"span",52),c(6),l()(),h(7,bt,4,1,"ng-container",27),a(8,"td")(9,"div",53),h(10,Ft,2,0,"div",54)(11,Tt,8,6,"div")(12,Dt,2,3)(13,Pt,4,1,"ng-container",5),l()(),h(14,Mt,11,7,"td",55)(15,Rt,5,2,"ng-container",5),a(16,"td",56),h(17,Lt,2,0,"ng-container",57)(18,Nt,4,8,"ng-template",null,0,Z),l()()),n&2){let e=p.$implicit,o=p.$index,t=K(19),i=r(3);s(),v(o==0?1:-1),s(2),O(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,ot,e.Discontinued)),s(),O(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,ne,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function Ot(n,p){if(n&1&&(a(0,"tbody"),G(1,At,20,18,"tr",null,z),l()),n&2){let e=p.$implicit;s(),Y(e.Variants)}}function Ut(n,p){if(n&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){d(e);let i=r();return _(i.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,mt,4,2,"div",5),g(4,"async"),l()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){d(e);let i=r();return _(i.onChannelChange(t))}),l()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),l(),a(13,"input",10),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),_(t)}),l()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),l(),a(17,"input",12),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),_(t)}),l()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),l(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),_(t)}),l(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),_(t)}),l()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,dt,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){d(e);let i=r();return _(i.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){d(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),l()()(),a(39,"th",25),c(40,"Variant"),l(),a(41,"th",26),c(42,"SKU"),l(),h(43,ut,3,3,"ng-container",27),a(44,"th",28),c(45," POS "),l(),a(46,"th",29)(47,"div",30),C("click",function(){d(e);let t=r();return _(t.openModalFilter())}),x(48,"img",31),a(49,"span",32),c(50),g(51,"stringLimit"),l()()(),h(52,ht,2,0,"th",33),a(53,"th",34),c(54,"Last Sync"),l()()(),G(55,Ot,3,0,"tbody",null,z),g(57,"async"),l(),a(58,"infinite-paginator",35),g(59,"async"),C("onNextPage",function(){d(e);let t=r();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){d(e);let t=r();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){d(e);let t=r();return _(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e,o,t,i=r();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",y(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,ne,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,A),s(2),I(" ",k(51,23,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),v(i.isShowReservedColumn?52:-1),s(3),Y(y(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",y(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var An=(()=>{class n{constructor(e,o,t,i,u,ie,Xe){this.http=e,this.toastr=o,this.dialog=t,this.productService=i,this.authService=u,this.biggerPictureService=ie,this.mainPanelService=Xe,this.infinitePagination=w(J),this.ngxPermissionsService=w(we),this.updateResHandling=w(te),this.inventoryService=w(R),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=V(null),this.channelIdentity=V({img:null,label:null}),this.inventoryUpdateRole=q.InventoryUpdate,this.hasInventoryEdit=V(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(H(e=>{this.checkShowReservedColumn(e)}),L(e=>(e=this.calculateAvailableStock(e),e)),N(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(q.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((i,u)=>(i+=u.I?.Available||0,i),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(i=>{t=i.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(N(1),H(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as R}from"./chunk-EHBCYQSG.js";import{b as ze}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as Ze}from"./chunk-QTTNQJAK.js";import"./chunk-IITU3NV6.js";import{a as ee}from"./chunk-XHAXYWZ7.js";import{a as Ge,b as Ye,c as Ke,d as J,e as te}from"./chunk-TKV7XWBT.js";import{a as Qe,b as He}from"./chunk-YTCIQBSO.js";import"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as We}from"./chunk-M7DDFDPD.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as q}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as Ue,b as Be,c as $e}from"./chunk-GHVAGYK3.js";import"./chunk-JVNHFIYT.js";import{a as je}from"./chunk-C7YK5TDP.js";import"./chunk-HAJDTNAW.js";import"./chunk-ACIMXBIC.js";import{i as Te}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-CGOB6Y3X.js";import{b as ve,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as De}from"./chunk-PYXL7UF7.js";import{c as f}from"./chunk-RXQX7567.js";import{b as Me,c as Ve,d as ke,j as Re,k as Le,l as Ne,m as Ae,n as Oe}from"./chunk-HJXYT6MI.js";import{A as ye,b as Ce,c as ge,h as fe,m as xe,o as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as be,c as Fe}from"./chunk-ERXVXBTU.js";import{r as Pe,s as Ee}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ue,J as he,d as me,g as de,j as $,k as W,m as _e,n as j}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as K,G as Q,Gb as U,Gc as c,Hc as O,Ic as I,Kc as b,Lc as F,Mb as h,Mc as T,Nc as re,Oc as se,Pc as ce,Qc as B,Ra as V,Rc as pe,Sc as M,Yb as m,Z as N,ac as ae,ad as y,bd as k,cd as Z,dc as v,ea as H,ec as z,gc as G,hc as Y,ic as a,jc as l,kc as x,lc as P,mc as E,oc as S,pa as w,pb as A,rb as s,tc as C,uc as r,v as L,xb as D,xc as le,ya as d,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as oe}from"./chunk-66YHNWRR.js";var tt=()=>["/menu/order/download"];function nt(n,p){if(n&1&&(a(0,"li",4)(1,"div"),c(2," The last time you manually download your order is on "),a(3,"span",8),c(4),g(5,"date"),l()(),a(6,"div",9),c(7),l()()),n&2){r();let e=ce(0);s(4),I(" ",k(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function it(n,p){n&1&&(a(0,"li",4),c(1," The last time you manually download your order is on (-) "),l())}var qe=(()=>{class n{constructor(){this.dialogRef=w(Me),this.data=w(Ve),this.modalConfig=new Re,this.inventoryService=w(R),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(L(e=>{let o=e.OrderDownloadLatestOn!=f.MinDate,t=null,i=null;return o&&(t=new Date(e.OrderDownloadLatestOn),i=f.convertToReadableDate(t)),{OrderDownloadLatestOn:t,calculatedDate:i}}),N(1)),this.selectedProducts=V(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-dialog-update-product-info"]],features:[B([R])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(o,t){if(o&1){let i=S();re(0),g(1,"async"),a(2,"modal-material",0),C("onCancel",function(){return d(i),_(t.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),c(6),l(),a(7,"div",3)(8,"ul"),h(9,nt,8,5,"li",4)(10,it,2,0,"li",4),l()()()(),a(11,"div",5)(12,"a",6),C("click",function(){return d(i),_(t.onCancel())}),c(13," Download "),l(),a(14,"button",7),C("click",function(){return d(i),_(t.onUpdate())})("keyup.F2",function(){return d(i),_(t.onUpdate())}),c(15," Update Anyway "),l()()()}if(o&2){let i=se(y(1,4,t.lastDownloadInfo$));s(2),m("config",t.modalConfig),s(4),I("",t.selectedProducts().length," Product(s) will be updated."),s(3),v(i!=null&&i.OrderDownloadLatestOn?9:10),s(3),m("routerLink",pe(7,tt))}},dependencies:[Le,j,$,W,he,ue],encapsulation:2})}}return n})();var ne=n=>[n],ot=n=>({"text-decoration-line-through":n}),at=n=>({"me-10":n}),lt=n=>({"bg-gradient-warning":n}),rt=n=>({cursor:n});function st(n,p){if(n&1){let e=S();a(0,"button",39),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onScanInventory(t))}),x(1,"i",40),c(2,"Refresh "),l()}}function ct(n,p){if(n&1){let e=S();a(0,"div",37)(1,"button",41),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onOpenDialogUpdateStockInfo(t))}),x(2,"i",42),c(3," Update "),l(),x(4,"button",43),a(5,"ul",44)(6,"a",45),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(7,"i",46),a(8,"span"),c(9,"Export"),l()()()()}}function pt(n,p){if(n&1){let e=S();a(0,"button",47),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(1,"i",46),a(2,"span"),c(3,"Export"),l()()}}function mt(n,p){if(n&1&&(a(0,"div"),h(1,st,3,0,"button",36)(2,ct,10,0,"div",37)(3,pt,4,0,"button",38),l()),n&2){let e=p.ngIf,o=r(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),v(o.productService.hasSelectionVariant(e)?2:3)}}function dt(n,p){n&1&&(a(0,"div",48)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function _t(n,p){if(n&1){let e=S();a(0,"th")(1,"input",49),T("ngModelChange",function(t){d(e);let i=r(3);return F(i.checkboxState,t)||(i.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=d(e).ngIf,i=r(3);return _(i.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(3);s(),b("ngModel",e.checkboxState)}}function ut(n,p){if(n&1&&(P(0),h(1,_t,2,1,"th",5),g(2,"async"),E()),n&2){let e=r(2);s(),m("ngIf",y(2,1,e.products$))}}function ht(n,p){n&1&&(a(0,"th",33),c(1," Reserved "),l())}function Ct(n,p){if(n&1){let e=S();a(0,"input",65),T("ngModelChange",function(t){d(e);let i=r(4).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),C("ngModelChange",function(){d(e);let t=r(4).$implicit,i=r(2);return _(i.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(4).$implicit;b("ngModel",e.selected)}}function gt(n,p){if(n&1&&(P(0),a(1,"div",63),h(2,Ct,1,1,"input",64),l(),E()),n&2){let e=r(3).$implicit;s(),m("ngClass",M(2,at,e.Variants.length<=1)),s(),v(e.Variants.length>1?2:-1)}}function ft(n,p){if(n&1){let e=S();a(0,"img",66),C("click",function(t){d(e);let i=r(3).$implicit,u=r(2);return _(u.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;le("src",e==null?null:e.ThumbnailUrl,A)}}function xt(n,p){n&1&&x(0,"img",60)}function St(n,p){if(n&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function yt(n,p){if(n&1&&(a(0,"td",58)(1,"div",14),h(2,gt,3,4,"ng-container",27),a(3,"div"),h(4,ft,1,1,"img",59)(5,xt,1,0,"img",60),l()()(),a(6,"td",61)(7,"span",62),c(8),l(),h(9,St,5,1),l()),n&2){let e=r(2).$implicit,o=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,ne,o.inventoryUpdateRole)),s(2),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),O(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function vt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(3).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(3).$implicit;b("ngModel",e.selected)}}function It(n,p){if(n&1&&h(0,vt,1,1,"input",70),n&2){let e=r(2).$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function wt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(2).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(2).$implicit;b("ngModel",e.selected)}}function bt(n,p){if(n&1&&(P(0),a(1,"td",69),h(2,It,1,1)(3,wt,1,1,"input",70),l(),E()),n&2){let e=r().$implicit;s(2),v((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function Ft(n,p){n&1&&(a(0,"div",71),c(1," Not Found "),l())}function Tt(n,p){if(n&1&&(a(0,"div")(1,"span",72),c(2),g(3,"number"),l(),c(4," => "),a(5,"span",73),c(6),g(7,"number"),l()()),n&2){let e=r().$implicit;s(2),I(" ",y(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),O(y(7,4,e==null?null:e.Inventory))}}function Dt(n,p){if(n&1&&(c(0),g(1,"number")),n&2){let e=r().$implicit;I(" ",y(1,1,e==null?null:e.Inventory)," ")}}function Pt(n,p){if(n&1&&(P(0),a(1,"div",74)(2,"a",75),x(3,"i",76),l()(),E()),n&2){let e=r().$implicit,o=r(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A)}}function Et(n,p){if(n&1){let e=S();a(0,"span",81),C("click",function(){d(e);let t=r(2).$implicit,i=r().$implicit,u=r(2);return _(u.openTableDialog(i,t))}),c(1),g(2,"number"),l()}if(n&2){let e=r(2).$implicit,o=r(3);ae(M(5,rt,o.hasInventoryEdit())),s(),I(" ",y(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Mt(n,p){if(n&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),h(3,Et,3,7,"span",78),g(4,"async"),l(),a(5,"div",74)(6,"a",75),x(7,"i",76),l()(),a(8,"div",74)(9,"span",79),C("click",function(){d(e);let t=r().$implicit,i=r(3);return _(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",80),l()()()()}if(n&2){let e=r().$implicit,o=r(3);m("ngClass",M(5,lt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",y(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function Vt(n,p){if(n&1&&(P(0),a(1,"span",82),c(2),g(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),I(" (",y(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function kt(n,p){n&1&&c(0," - ")}function Rt(n,p){if(n&1&&(P(0),a(1,"td",51),h(2,Vt,4,3,"ng-container",57)(3,kt,1,0,"ng-template",null,1,Z),l(),E()),n&2){let e=K(4),o=r().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Lt(n,p){n&1&&(P(0),c(1," - "),E())}function Nt(n,p){if(n&1&&(a(0,"span",83),g(1,"date"),c(2),g(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",k(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",k(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function At(n,p){if(n&1&&(a(0,"tr"),h(1,yt,10,8),a(2,"td",50),c(3),l(),a(4,"td",51)(5,"span",52),c(6),l()(),h(7,bt,4,1,"ng-container",27),a(8,"td")(9,"div",53),h(10,Ft,2,0,"div",54)(11,Tt,8,6,"div")(12,Dt,2,3)(13,Pt,4,1,"ng-container",5),l()(),h(14,Mt,11,7,"td",55)(15,Rt,5,2,"ng-container",5),a(16,"td",56),h(17,Lt,2,0,"ng-container",57)(18,Nt,4,8,"ng-template",null,0,Z),l()()),n&2){let e=p.$implicit,o=p.$index,t=K(19),i=r(3);s(),v(o==0?1:-1),s(2),O(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,ot,e.Discontinued)),s(),O(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,ne,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function Ot(n,p){if(n&1&&(a(0,"tbody"),G(1,At,20,18,"tr",null,z),l()),n&2){let e=p.$implicit;s(),Y(e.Variants)}}function Ut(n,p){if(n&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){d(e);let i=r();return _(i.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,mt,4,2,"div",5),g(4,"async"),l()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){d(e);let i=r();return _(i.onChannelChange(t))}),l()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),l(),a(13,"input",10),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),_(t)}),l()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),l(),a(17,"input",12),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),_(t)}),l()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),l(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),_(t)}),l(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),_(t)}),l()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,dt,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){d(e);let i=r();return _(i.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){d(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),l()()(),a(39,"th",25),c(40,"Variant"),l(),a(41,"th",26),c(42,"SKU"),l(),h(43,ut,3,3,"ng-container",27),a(44,"th",28),c(45," POS "),l(),a(46,"th",29)(47,"div",30),C("click",function(){d(e);let t=r();return _(t.openModalFilter())}),x(48,"img",31),a(49,"span",32),c(50),g(51,"stringLimit"),l()()(),h(52,ht,2,0,"th",33),a(53,"th",34),c(54,"Last Sync"),l()()(),G(55,Ot,3,0,"tbody",null,z),g(57,"async"),l(),a(58,"infinite-paginator",35),g(59,"async"),C("onNextPage",function(){d(e);let t=r();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){d(e);let t=r();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){d(e);let t=r();return _(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e,o,t,i=r();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",y(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,ne,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,A),s(2),I(" ",k(51,23,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),v(i.isShowReservedColumn?52:-1),s(3),Y(y(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",y(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var An=(()=>{class n{constructor(e,o,t,i,u,ie,Xe){this.http=e,this.toastr=o,this.dialog=t,this.productService=i,this.authService=u,this.biggerPictureService=ie,this.mainPanelService=Xe,this.infinitePagination=w(J),this.ngxPermissionsService=w(we),this.updateResHandling=w(te),this.inventoryService=w(R),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=V(null),this.channelIdentity=V({img:null,label:null}),this.inventoryUpdateRole=q.InventoryUpdate,this.hasInventoryEdit=V(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(H(e=>{this.checkShowReservedColumn(e)}),L(e=>(e=this.calculateAvailableStock(e),e)),N(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(q.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((i,u)=>(i+=u.I?.Available||0,i),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(i=>{t=i.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(N(1),H(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}onOpenDialogUpdateStockInfo(e){let o=this.productService.selectedVariantProduct(e);this.dialog.open(qe,{data:{channelId:o[0]?.Channel[0]?.ChannelID,selectedProducts:o}}).afterClosed().pipe(Q(t=>t===!0)).subscribe(()=>{this.updateStock(o)})}updateStock(e){if(e.length>0){let o=this.searchFilter.LocationID,t=e.map(u=>oe({ChannelItemID:u?.Channel[0]?.ChannelItemID,ChannelVariationID:u?.Channel[0]?.ChannelVariationID,Inventory:u.Inventory},f.IsNotEmpty(o)&&{LocationID:o})),i={ListChannelID:[this.searchFilter.ChannelID],List:t};this.http.post(X.UpdateInventoryChannel,i).subscribe(u=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(u)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,t=e[0]?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,t,i){let u={ChannelItemID:e,ChannelVariationID:o,ChannelID:t,VariantID:i};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(ie=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(t=>(t.selected=this.checkboxState,t)),o))}openTableDialog(e,o){this.hasInventoryEdit()&&this.dialog.open(Ge,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(Q(i=>f.IsNotEmpty(i))).subscribe(i=>{this.updateItemAfterDialog(i)})}updateItemAfterDialog(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e?.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(X.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([i])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(ze,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=ee.DIFFERENCE:this.searchFilter.filterModel=ee.ALL,this.initReloadData()}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(L(o=>o.map(t=>(t.Variants=t.Variants.sort((i,u)=>f.compare(i.I?.Available,u.I?.Available,e.direction==="asc")),t)).sort((t,i)=>f.compare(t.totalAvailable,i.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||n)(D(Ie),D(ve),D(ke),D(We),D(Te),D(je),D(Ne))}}static{this.\u0275cmp=U({type:n,selectors:[["app-single-channel-comparison"]],features:[B([J,R,te])],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],[4,"ngxPermissionsOnly"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[3,"ngClass"],["type","checkbox",1,"me-3",3,"ngModel"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],[3,"class","click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(o,t){o&1&&(h(0,Ut,60,32,"mainpanel",2),g(1,"async")),o&2&&m("ngIf",y(1,1,t.loader$))},dependencies:[j,me,de,$,_e,W,Oe,Ae,De,ye,ge,Se,Ce,fe,xe,Ye,Ke,Fe,be,He,Qe,Ee,Pe,$e,Ue,Be,Ze],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]})}}return n})();export{An as SingleChannelComparisonComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ft}from"./chunk-XPCRS7AL.js";import{a as At,b as he}from"./chunk-MX5SR3SR.js";import{a as Vt}from"./chunk-Q4N2QUV6.js";import{a as Lt,b as Je}from"./chunk-YQLOB7IQ.js";import{e as Xe}from"./chunk-OZ7LWNOK.js";import{a as Ye}from"./chunk-YFDFIBAG.js";import{A as kt,F as St,I as Tt,M as Mt,P as Qe,R as V,V as Ue,W as We,_ as wt,aa as Pt,f as Ze,fa as Dt,k as bt,ka as Ot,m as vt,n as yt,na as Et,oa as de,q as Ee,r as Le,w as Ct,x as qe}from"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-ACIMXBIC.js";import{a as S}from"./chunk-CGOB6Y3X.js";import{e as Ce}from"./chunk-WN5DZGA4.js";import{c as je,d as Ge,f as me,i as pe}from"./chunk-4NEKWRL7.js";import{c as ke,d as Se,e as Te}from"./chunk-PYXL7UF7.js";import{b as x,c as He}from"./chunk-PW42BQIY.js";import{b as Me,c as we,d as xt,e as Pe,f as De,g as It,h as Oe}from"./chunk-HJXYT6MI.js";import{A as F,h as ve,m as ye}from"./chunk-5PS6ZS3N.js";import{r as gt,s as ft}from"./chunk-MFQQEEHJ.js";import{H as _t,J as ze,d as Re,f as dt,g as Ne,h as Be,i as ht,k as be,n as T,o as ce}from"./chunk-FXQKRJWU.js";import{$b as ct,$c as q,Ac as G,Bc as w,Ca as st,Cc as P,Fc as fe,G as Y,Gb as C,Gc as u,Hb as lt,Hc as M,Ic as oe,Ka as L,Kb as $e,Kc as re,Lc as se,Mb as f,Mc as ae,Na as H,Oa as j,Qc as mt,Ra as I,Rc as Z,Sc as xe,Tc as pt,Xb as v,Yb as a,_b as Ke,aa as R,ac as N,bd as Q,cd as le,dc as X,ec as J,gc as ee,hc as te,ia as ot,ic as l,ja as E,jc as m,ka as rt,kc as y,lc as ie,mc as ne,ob as Ve,oc as k,od as B,pa as b,pb as at,pd as U,rb as c,rd as Ie,sd as ut,tc as _,uc as r,v as W,xb as Ae,ya as d,za as h,zc as ge}from"./chunk-OJMQBH6T.js";import{a as D,b as O}from"./chunk-66YHNWRR.js";var $t=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(S.ShopeeSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(S.ShopeeSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Kt=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(W(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(S.TiktokSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(S.TiktokSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=He.convertTimestampToDate(t.start_time),o=He.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=o,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Zt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("DROP_OFF"))}),l(1,"div",11),y(2,"i",12),l(3,"h3",13),u(4,"Drop off"),m()(),l(5,"p",14),u(6," You can drop off your package at the nearest shipping counter in your city. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function qt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("PICK_UP"))}),l(1,"div",11),y(2,"i",15),l(3,"h3",16),u(4,"Pick up"),m()(),l(5,"p",17),u(6," The courier will collect the package from your address. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var et=(()=>{class n{constructor(){this.data=b(we),this.dialogRef=b(Me),this.selectedDelivery=I("DROP_OFF"),this.showPickup=I(!0),this.showDropOff=I(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case x.Shopee:break;case x.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),u(4,"Delivery Order"),m(),l(5,"div",3),u(6,"Your selected order(s) will be set to"),m()(),l(7,"div")(8,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(9,"mat-dialog-content",5)(10,"div",6),f(11,Zt,7,4,"div",7)(12,qt,7,4,"div",7),m(),l(13,"div",8)(14,"button",9),_("click",function(){return i.onConfirm()}),u(15," OK "),m()()()),t&2&&(c(11),X(i.showPickup()?11:-1),c(),X(i.showDropOff()?12:-1))},dependencies:[T,Oe,Pe,De],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Wt(n,p){if(n&1&&(l(0,"ng-option",3),u(1),m()),n&2){let e=p.$implicit;a("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),c(),M(e==null?null:e.address)}}function Yt(n,p){if(n&1&&(l(0,"ng-option",6)(1,"span",7),u(2),q(3,"date"),m(),l(4,"span"),u(5),m()()),n&2){let e=p.$implicit;a("value",e==null?null:e.pickup_time_id),c(2),M(Q(3,3,e==null?null:e.date,"d MMMM")),c(3),M(e==null?null:e.time_text)}}var Nt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.addressList=Ie(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=I(null),this.timeOptions=I(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=I(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return O(D({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Address"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedShipping,s)||(i.selectedShipping=s),s}),_("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),ee(4,Wt,2,3,"ng-option",3,J),m()(),l(6,"div",0)(7,"label",4),u(8,"Date"),m(),l(9,"ng-select",5),ae("ngModelChange",function(s){return se(i.pickupTime,s)||(i.pickupTime=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(10,Yt,6,6,"ng-option",6,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedShipping),c(),te(i.addressList()),c(5),a("clearable",!1),re("ngModel",i.pickupTime),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,F,ve,ye,ft,gt],encapsulation:2})}}return n})();function Xt(n,p){if(n&1&&(l(0,"ng-option",3)(1,"span",4),u(2),q(3,"date"),m(),l(4,"span"),u(5),q(6,"date"),m(),l(7,"span",5),u(8,"-"),m(),l(9,"span"),u(10),q(11,"date"),m()()),n&2){let e=p.$implicit,t=p.$index;a("value",t),c(2),M(Q(3,4,e==null?null:e.start_date,"d MMMM")),c(3),M(Q(6,7,e==null?null:e.start_date,"HH:mm")),c(5),M(Q(11,10,e==null?null:e.end_date,"HH:mm"))}}var Bt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.timeOptions=Ie(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=I(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Time"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(4,Xt,12,13,"ng-option",3,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedTimeIndex),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,F,ve,ye],encapsulation:2})}}return n})();function Jt(n,p){if(n&1){let e=k();l(0,"shopee-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}function ei(n,p){if(n&1){let e=k();l(0,"tiktok-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}var tt=(()=>{class n{constructor(){this.dialogRef=b(Me),this.dialogData=b(we),this.shippingOptions=I(this.dialogData.shippingOptions),this.channelType=I(this.dialogData.channelType),this.order=I(this.dialogData.order),this.channelTypeEnum=x,this.pickupData=I(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){let e=this.dialogData.multipleOrder??!1;switch(this.channelType()){case x.Shopee:return e?{pickup:this.pickupData()}:{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case x.Tiktok:return e?{pickup_slot:this.pickupData(),handover_method:"PICKUP"}:{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(l(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),u(4,"Set Pickup"),m(),l(5,"div",2)(6,"div",3),u(7,"Shipping Method"),m(),l(8,"div",3),u(9),m()()(),l(10,"div")(11,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(12,"mat-dialog-content",5),f(13,Jt,1,1,"shopee-pickup",6)(14,ei,1,1,"tiktok-pickup",6),m(),l(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),_("click",function(){return i.onClose()}),u(18," Cancel "),m(),l(19,"button",9),_("click",function(){return i.onSave()}),u(20," Ok "),m()()()),t&2){let o,s;c(9),oe(" ",!((o=i.order())==null||o.LogisticService==null)&&o.LogisticService.Name?(o=i.order())==null||o.LogisticService==null?null:o.LogisticService.Name:"-"," "),c(4),X((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[T,Oe,Pe,It,De,F,Nt,Bt],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var Zn=(()=>{class n{constructor(){this.shopeeShippingService=b($t),this.tiktokShippingService=b(Kt),this.dialog=b(xt)}setFulfillmentOrder(e){return this.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(R(t=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),W(i=>({type:i,order:e,options:t})),R(i=>i.type=="PICK_UP"?this.onPickupOrder(i.order,i.options):this.onDropOffOrder(i.order,i.options)))))}onPickupOrder(e,t){return this.dialog.open(tt,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType,multipleOrder:!1},disableClose:!0}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),R(i=>this.pickupOrder(e,i)))}pickupOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(t);case x.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}onDropOffOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case x.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}setFulfillmentMultipleOrders(e){let t=e[0];return this.getShippingOptions(t.Number,t.ShopID,t.MarketType).pipe(R(i=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:i,channelType:t.MarketType}}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),W(o=>({type:o,orders:e,options:i})))),R(i=>i.type=="PICK_UP"?this.openDialogPickupMultipleOrders(i.orders,i.options):this.dropOffMultipleOrder(i.orders,i.options)))}openDialogPickupMultipleOrders(e,t){let i=e[0];return this.dialog.open(tt,{width:"530px",data:{order:i,shippingOptions:t,channelType:i.MarketType,multipleOrder:!0},disableClose:!0}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),R(o=>this.pickupMultipleOrder(e,o)))}pickupMultipleOrder(e,t){let i=e[0],o=this.generateMultiplePickupData(e,t);switch(i.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(o);case x.Tiktok:return this.tiktokShippingService.pickupOrder(o)}}generateMultiplePickupData(e,t){switch(e[0].MarketType){case x.Shopee:let i=e.map(s=>({OrderNumber:s.Number,ShopID:s.ShopID}));return t.List=i,t;case x.Tiktok:let o=e.map(s=>({PackageID:s.Number,ShopID:s.ShopID}));return t.List=o,t}}dropOffMultipleOrder(e,t){switch(e[0].MarketType){case x.Shopee:let o=this.generateMultipleDropOffData(e);return this.shopeeShippingService.dropOffMultipleOrders(o);case x.Tiktok:let s=t?.Form?.information?.PackageID,g=this.generateMultipleDropOffData(e,s);return this.tiktokShippingService.dropOffMultipleOrders(g)}}generateMultipleDropOffData(e,t){switch(e[0].MarketType){case x.Shopee:return e.map(g=>({OrderNumber:g.Number,ShopID:g.ShopID}));case x.Tiktok:return{List:e.map(g=>({PackageID:t,ShopID:g.ShopID})),handover_method:"DROP_OFF"}}}getShippingOptions(e,t,i){switch(i){case x.Shopee:return this.getShopeeShippingOptions(e,t);case x.Tiktok:return this.getTiktokShippingOptions(e,t)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var ti=["sublist"],ii=(n,p)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":p}),ni=()=>({"p-contextmenu-item-link":!0}),Ht=()=>({class:"p-contextmenu-submenu-icon"}),oi=()=>({exact:!1}),ri=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),si=n=>({$implicit:n});function ai(n,p){if(n&1&&y(0,"li",8),n&2){let e=r().$implicit,t=r(2);ct(t.getItemProp(e,"style")),a("ngClass",t.getSeparatorItemClass(e)),v("id",t.getItemId(e))("data-pc-section","separator")}}function li(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function ci(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function mi(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Ve),v("data-pc-section","label")}}function pi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function ui(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function di(n,p){}function hi(n,p){n&1&&f(0,di,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function _i(n,p){if(n&1&&(ie(0),f(1,ui,1,4,"AngleRightIcon",23)(2,hi,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function gi(n,p){if(n&1&&(l(0,"a",15),f(1,li,1,5,"span",16)(2,ci,2,2,"span",17)(3,mi,1,2,"ng-template",null,2,le)(5,pi,1,2,"p-badge",18)(6,_i,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("target",i.getItemProp(t,"target"))("ngClass",Z(12,ni)),v("href",i.getItemProp(t,"url"),at)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function fi(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function xi(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function Ii(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Ve),v("data-pc-section","label")}}function bi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function vi(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function yi(n,p){}function Ci(n,p){n&1&&f(0,yi,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function ki(n,p){if(n&1&&(ie(0),f(1,vi,1,4,"AngleRightIcon",23)(2,Ci,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function Si(n,p){if(n&1&&(l(0,"a",26),f(1,fi,1,5,"span",16)(2,xi,2,2,"span",17)(3,Ii,1,2,"ng-template",null,2,le)(5,bi,1,2,"p-badge",18)(6,ki,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||Z(20,oi))("target",i.getItemProp(t,"target"))("ngClass",xe(21,ri,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),v("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function Ti(n,p){if(n&1&&(ie(0),f(1,gi,7,13,"a",13)(2,Si,7,23,"a",14),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngIf",!t.getItemProp(e,"routerLink")),c(),a("ngIf",t.getItemProp(e,"routerLink"))}}function Mi(n,p){}function wi(n,p){n&1&&f(0,Mi,0,0,"ng-template")}function Pi(n,p){if(n&1&&(ie(0),f(1,wi,1,0,null,24),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",xe(2,si,e.item))}}function Di(n,p){if(n&1){let e=k();l(0,"p-contextmenu-sub",27),_("itemClick",function(i){d(e);let o=r(4);return h(o.itemClick.emit(i))})("itemMouseEnter",function(i){d(e);let o=r(4);return h(o.onItemMouseEnter(i))}),m()}if(n&2){let e=r(2).$implicit,t=r(2);a("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function Oi(n,p){if(n&1){let e=k();l(0,"li",9,1)(2,"div",10),_("click",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemClick(i,o))})("mouseenter",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemMouseEnter({$event:i,processedItem:o}))}),f(3,Ti,3,2,"ng-container",11)(4,Pi,2,4,"ng-container",11),m(),f(5,Di,1,7,"p-contextmenu-sub",12),m()}if(n&2){let e=r(),t=e.$implicit,i=e.index,o=r(2);N(o.getItemProp(t,"styleClass")),a("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),v("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),c(2),v("data-pc-section","content"),c(),a("ngIf",!o.itemTemplate),c(),a("ngIf",o.itemTemplate),c(),a("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Ei(n,p){if(n&1&&f(0,ai,1,5,"li",6)(1,Oi,6,21,"li",7),n&2){let e=p.$implicit,t=r(2);a("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),c(),a("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Li(n,p){if(n&1){let e=k();l(0,"ul",4,0),_("@overlayAnimation.start",function(i){d(e);let o=fe(1),s=r();return h(s.onEnter(i,o))})("keydown",function(i){d(e);let o=r();return h(o.menuKeydown.emit(i))})("focus",function(i){d(e);let o=r();return h(o.menuFocus.emit(i))})("blur",function(i){d(e);let o=r();return h(o.menuBlur.emit(i))}),f(2,Ei,2,2,"ng-template",5),m()}if(n&2){let e=r();a("ngClass",pt(10,ii,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),v("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),a("ngForOf",e.items)}}var Fi=["item"],Vi=["submenuicon"],Ai=["rootmenu"],$i=["container"],Ki=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),Ri=()=>({value:"visible"});function Ni(n,p){if(n&1){let e=k();l(0,"div",3,0),_("@overlayAnimation.start",function(i){d(e);let o=r();return h(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){d(e);let o=r();return h(o.onOverlayAnimationEnd(i))}),l(2,"p-contextmenu-sub",4,1),_("itemClick",function(i){d(e);let o=r();return h(o.onItemClick(i))})("menuFocus",function(i){d(e);let o=r();return h(o.onMenuFocus(i))})("menuBlur",function(i){d(e);let o=r();return h(o.onMenuBlur(i))})("menuKeydown",function(i){d(e);let o=r();return h(o.onKeyDown(i))})("itemMouseEnter",function(i){d(e);let o=r();return h(o.onItemMouseEnter(i))}),m()()}if(n&2){let e=r();N(e.styleClass),a("ngClass",xe(20,Ki,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",Z(22,Ri)),v("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),a("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Bi=({dt:n})=>`
|
|
1
|
+
import{a as Vt}from"./chunk-XPCRS7AL.js";import{a as At,b as he}from"./chunk-MX5SR3SR.js";import{a as Ft}from"./chunk-Q4N2QUV6.js";import{a as Lt,b as Je}from"./chunk-YQLOB7IQ.js";import{e as Xe}from"./chunk-OZ7LWNOK.js";import{a as Ye}from"./chunk-YFDFIBAG.js";import{A as kt,F as St,I as Tt,M as Mt,P as Qe,R as F,V as Ue,W as We,_ as wt,aa as Pt,f as Ze,fa as Dt,k as bt,ka as Ot,m as vt,n as yt,na as Et,oa as de,q as Ee,r as Le,w as Ct,x as qe}from"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-ACIMXBIC.js";import{a as S}from"./chunk-CGOB6Y3X.js";import{e as Ce}from"./chunk-WN5DZGA4.js";import{c as je,d as Ge,f as me,i as pe}from"./chunk-4NEKWRL7.js";import{c as ke,d as Se,e as Te}from"./chunk-PYXL7UF7.js";import{b as x,c as He}from"./chunk-RXQX7567.js";import{b as Me,c as we,d as xt,e as Pe,f as De,g as It,h as Oe}from"./chunk-HJXYT6MI.js";import{A as V,h as ve,m as ye}from"./chunk-5PS6ZS3N.js";import{r as gt,s as ft}from"./chunk-MFQQEEHJ.js";import{H as _t,J as ze,d as Re,f as dt,g as Ne,h as Be,i as ht,k as be,n as T,o as ce}from"./chunk-FXQKRJWU.js";import{$b as ct,$c as q,Ac as G,Bc as w,Ca as st,Cc as P,Fc as fe,G as Y,Gb as C,Gc as u,Hb as lt,Hc as M,Ic as oe,Ka as L,Kb as $e,Kc as re,Lc as se,Mb as f,Mc as ae,Na as H,Oa as j,Qc as mt,Ra as I,Rc as Z,Sc as xe,Tc as pt,Xb as v,Yb as a,_b as Ke,aa as R,ac as N,bd as Q,cd as le,dc as X,ec as J,gc as ee,hc as te,ia as ot,ic as l,ja as E,jc as m,ka as rt,kc as y,lc as ie,mc as ne,ob as Fe,oc as k,od as B,pa as b,pb as at,pd as U,rb as c,rd as Ie,sd as ut,tc as _,uc as r,v as W,xb as Ae,ya as d,za as h,zc as ge}from"./chunk-OJMQBH6T.js";import{a as D,b as O}from"./chunk-66YHNWRR.js";var $t=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(S.ShopeeSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(S.ShopeeSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Kt=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(W(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(S.TiktokSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(S.TiktokSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=He.convertTimestampToDate(t.start_time),o=He.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=o,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Zt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("DROP_OFF"))}),l(1,"div",11),y(2,"i",12),l(3,"h3",13),u(4,"Drop off"),m()(),l(5,"p",14),u(6," You can drop off your package at the nearest shipping counter in your city. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function qt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("PICK_UP"))}),l(1,"div",11),y(2,"i",15),l(3,"h3",16),u(4,"Pick up"),m()(),l(5,"p",17),u(6," The courier will collect the package from your address. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var et=(()=>{class n{constructor(){this.data=b(we),this.dialogRef=b(Me),this.selectedDelivery=I("DROP_OFF"),this.showPickup=I(!0),this.showDropOff=I(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case x.Shopee:break;case x.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),u(4,"Delivery Order"),m(),l(5,"div",3),u(6,"Your selected order(s) will be set to"),m()(),l(7,"div")(8,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(9,"mat-dialog-content",5)(10,"div",6),f(11,Zt,7,4,"div",7)(12,qt,7,4,"div",7),m(),l(13,"div",8)(14,"button",9),_("click",function(){return i.onConfirm()}),u(15," OK "),m()()()),t&2&&(c(11),X(i.showPickup()?11:-1),c(),X(i.showDropOff()?12:-1))},dependencies:[T,Oe,Pe,De],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Wt(n,p){if(n&1&&(l(0,"ng-option",3),u(1),m()),n&2){let e=p.$implicit;a("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),c(),M(e==null?null:e.address)}}function Yt(n,p){if(n&1&&(l(0,"ng-option",6)(1,"span",7),u(2),q(3,"date"),m(),l(4,"span"),u(5),m()()),n&2){let e=p.$implicit;a("value",e==null?null:e.pickup_time_id),c(2),M(Q(3,3,e==null?null:e.date,"d MMMM")),c(3),M(e==null?null:e.time_text)}}var Nt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.addressList=Ie(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=I(null),this.timeOptions=I(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=I(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return O(D({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Address"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedShipping,s)||(i.selectedShipping=s),s}),_("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),ee(4,Wt,2,3,"ng-option",3,J),m()(),l(6,"div",0)(7,"label",4),u(8,"Date"),m(),l(9,"ng-select",5),ae("ngModelChange",function(s){return se(i.pickupTime,s)||(i.pickupTime=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(10,Yt,6,6,"ng-option",6,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedShipping),c(),te(i.addressList()),c(5),a("clearable",!1),re("ngModel",i.pickupTime),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,V,ve,ye,ft,gt],encapsulation:2})}}return n})();function Xt(n,p){if(n&1&&(l(0,"ng-option",3)(1,"span",4),u(2),q(3,"date"),m(),l(4,"span"),u(5),q(6,"date"),m(),l(7,"span",5),u(8,"-"),m(),l(9,"span"),u(10),q(11,"date"),m()()),n&2){let e=p.$implicit,t=p.$index;a("value",t),c(2),M(Q(3,4,e==null?null:e.start_date,"d MMMM")),c(3),M(Q(6,7,e==null?null:e.start_date,"HH:mm")),c(5),M(Q(11,10,e==null?null:e.end_date,"HH:mm"))}}var Bt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.timeOptions=Ie(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=I(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Time"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(4,Xt,12,13,"ng-option",3,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedTimeIndex),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,V,ve,ye],encapsulation:2})}}return n})();function Jt(n,p){if(n&1){let e=k();l(0,"shopee-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}function ei(n,p){if(n&1){let e=k();l(0,"tiktok-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}var tt=(()=>{class n{constructor(){this.dialogRef=b(Me),this.dialogData=b(we),this.shippingOptions=I(this.dialogData.shippingOptions),this.channelType=I(this.dialogData.channelType),this.order=I(this.dialogData.order),this.channelTypeEnum=x,this.pickupData=I(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){let e=this.dialogData.multipleOrder??!1;switch(this.channelType()){case x.Shopee:return e?{pickup:this.pickupData()}:{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case x.Tiktok:return e?{pickup_slot:this.pickupData(),handover_method:"PICKUP"}:{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(l(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),u(4,"Set Pickup"),m(),l(5,"div",2)(6,"div",3),u(7,"Shipping Method"),m(),l(8,"div",3),u(9),m()()(),l(10,"div")(11,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(12,"mat-dialog-content",5),f(13,Jt,1,1,"shopee-pickup",6)(14,ei,1,1,"tiktok-pickup",6),m(),l(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),_("click",function(){return i.onClose()}),u(18," Cancel "),m(),l(19,"button",9),_("click",function(){return i.onSave()}),u(20," Ok "),m()()()),t&2){let o,s;c(9),oe(" ",!((o=i.order())==null||o.LogisticService==null)&&o.LogisticService.Name?(o=i.order())==null||o.LogisticService==null?null:o.LogisticService.Name:"-"," "),c(4),X((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[T,Oe,Pe,It,De,V,Nt,Bt],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 7 Pro";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var Zn=(()=>{class n{constructor(){this.shopeeShippingService=b($t),this.tiktokShippingService=b(Kt),this.dialog=b(xt)}setFulfillmentOrder(e){return this.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(R(t=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),W(i=>({type:i,order:e,options:t})),R(i=>i.type=="PICK_UP"?this.onPickupOrder(i.order,i.options):this.onDropOffOrder(i.order,i.options)))))}onPickupOrder(e,t){return this.dialog.open(tt,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType,multipleOrder:!1},disableClose:!0}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),R(i=>this.pickupOrder(e,i)))}pickupOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(t);case x.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}onDropOffOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case x.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}setFulfillmentMultipleOrders(e){let t=e[0];return this.getShippingOptions(t.Number,t.ShopID,t.MarketType).pipe(R(i=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:i,channelType:t.MarketType}}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),W(o=>({type:o,orders:e,options:i})))),R(i=>i.type=="PICK_UP"?this.openDialogPickupMultipleOrders(i.orders,i.options):this.dropOffMultipleOrder(i.orders,i.options)))}openDialogPickupMultipleOrders(e,t){let i=e[0];return this.dialog.open(tt,{width:"530px",data:{order:i,shippingOptions:t,channelType:i.MarketType,multipleOrder:!0},disableClose:!0}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),R(o=>this.pickupMultipleOrder(e,o)))}pickupMultipleOrder(e,t){let i=e[0],o=this.generateMultiplePickupData(e,t);switch(i.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(o);case x.Tiktok:return this.tiktokShippingService.pickupOrder(o)}}generateMultiplePickupData(e,t){switch(e[0].MarketType){case x.Shopee:let i=e.map(s=>({OrderNumber:s.Number,ShopID:s.ShopID}));return t.List=i,t;case x.Tiktok:let o=e.map(s=>({PackageID:s.Number,ShopID:s.ShopID}));return t.List=o,t}}dropOffMultipleOrder(e,t){switch(e[0].MarketType){case x.Shopee:let o=this.generateMultipleDropOffData(e);return this.shopeeShippingService.dropOffMultipleOrders(o);case x.Tiktok:let s=t?.Form?.information?.PackageID,g=this.generateMultipleDropOffData(e,s);return this.tiktokShippingService.dropOffMultipleOrders(g)}}generateMultipleDropOffData(e,t){switch(e[0].MarketType){case x.Shopee:return e.map(g=>({OrderNumber:g.Number,ShopID:g.ShopID}));case x.Tiktok:return{List:e.map(g=>({PackageID:t,ShopID:g.ShopID})),handover_method:"DROP_OFF"}}}getShippingOptions(e,t,i){switch(i){case x.Shopee:return this.getShopeeShippingOptions(e,t);case x.Tiktok:return this.getTiktokShippingOptions(e,t)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var ti=["sublist"],ii=(n,p)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":p}),ni=()=>({"p-contextmenu-item-link":!0}),Ht=()=>({class:"p-contextmenu-submenu-icon"}),oi=()=>({exact:!1}),ri=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),si=n=>({$implicit:n});function ai(n,p){if(n&1&&y(0,"li",8),n&2){let e=r().$implicit,t=r(2);ct(t.getItemProp(e,"style")),a("ngClass",t.getSeparatorItemClass(e)),v("id",t.getItemId(e))("data-pc-section","separator")}}function li(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function ci(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function mi(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Fe),v("data-pc-section","label")}}function pi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function ui(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function di(n,p){}function hi(n,p){n&1&&f(0,di,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function _i(n,p){if(n&1&&(ie(0),f(1,ui,1,4,"AngleRightIcon",23)(2,hi,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function gi(n,p){if(n&1&&(l(0,"a",15),f(1,li,1,5,"span",16)(2,ci,2,2,"span",17)(3,mi,1,2,"ng-template",null,2,le)(5,pi,1,2,"p-badge",18)(6,_i,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("target",i.getItemProp(t,"target"))("ngClass",Z(12,ni)),v("href",i.getItemProp(t,"url"),at)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function fi(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function xi(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function Ii(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Fe),v("data-pc-section","label")}}function bi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function vi(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function yi(n,p){}function Ci(n,p){n&1&&f(0,yi,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function ki(n,p){if(n&1&&(ie(0),f(1,vi,1,4,"AngleRightIcon",23)(2,Ci,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function Si(n,p){if(n&1&&(l(0,"a",26),f(1,fi,1,5,"span",16)(2,xi,2,2,"span",17)(3,Ii,1,2,"ng-template",null,2,le)(5,bi,1,2,"p-badge",18)(6,ki,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||Z(20,oi))("target",i.getItemProp(t,"target"))("ngClass",xe(21,ri,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),v("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function Ti(n,p){if(n&1&&(ie(0),f(1,gi,7,13,"a",13)(2,Si,7,23,"a",14),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngIf",!t.getItemProp(e,"routerLink")),c(),a("ngIf",t.getItemProp(e,"routerLink"))}}function Mi(n,p){}function wi(n,p){n&1&&f(0,Mi,0,0,"ng-template")}function Pi(n,p){if(n&1&&(ie(0),f(1,wi,1,0,null,24),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",xe(2,si,e.item))}}function Di(n,p){if(n&1){let e=k();l(0,"p-contextmenu-sub",27),_("itemClick",function(i){d(e);let o=r(4);return h(o.itemClick.emit(i))})("itemMouseEnter",function(i){d(e);let o=r(4);return h(o.onItemMouseEnter(i))}),m()}if(n&2){let e=r(2).$implicit,t=r(2);a("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function Oi(n,p){if(n&1){let e=k();l(0,"li",9,1)(2,"div",10),_("click",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemClick(i,o))})("mouseenter",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemMouseEnter({$event:i,processedItem:o}))}),f(3,Ti,3,2,"ng-container",11)(4,Pi,2,4,"ng-container",11),m(),f(5,Di,1,7,"p-contextmenu-sub",12),m()}if(n&2){let e=r(),t=e.$implicit,i=e.index,o=r(2);N(o.getItemProp(t,"styleClass")),a("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),v("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),c(2),v("data-pc-section","content"),c(),a("ngIf",!o.itemTemplate),c(),a("ngIf",o.itemTemplate),c(),a("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Ei(n,p){if(n&1&&f(0,ai,1,5,"li",6)(1,Oi,6,21,"li",7),n&2){let e=p.$implicit,t=r(2);a("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),c(),a("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Li(n,p){if(n&1){let e=k();l(0,"ul",4,0),_("@overlayAnimation.start",function(i){d(e);let o=fe(1),s=r();return h(s.onEnter(i,o))})("keydown",function(i){d(e);let o=r();return h(o.menuKeydown.emit(i))})("focus",function(i){d(e);let o=r();return h(o.menuFocus.emit(i))})("blur",function(i){d(e);let o=r();return h(o.menuBlur.emit(i))}),f(2,Ei,2,2,"ng-template",5),m()}if(n&2){let e=r();a("ngClass",pt(10,ii,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),v("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),a("ngForOf",e.items)}}var Vi=["item"],Fi=["submenuicon"],Ai=["rootmenu"],$i=["container"],Ki=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),Ri=()=>({value:"visible"});function Ni(n,p){if(n&1){let e=k();l(0,"div",3,0),_("@overlayAnimation.start",function(i){d(e);let o=r();return h(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){d(e);let o=r();return h(o.onOverlayAnimationEnd(i))}),l(2,"p-contextmenu-sub",4,1),_("itemClick",function(i){d(e);let o=r();return h(o.onItemClick(i))})("menuFocus",function(i){d(e);let o=r();return h(o.onMenuFocus(i))})("menuBlur",function(i){d(e);let o=r();return h(o.onMenuBlur(i))})("menuKeydown",function(i){d(e);let o=r();return h(o.onKeyDown(i))})("itemMouseEnter",function(i){d(e);let o=r();return h(o.onItemMouseEnter(i))}),m()()}if(n&2){let e=r();N(e.styleClass),a("ngClass",xe(20,Ki,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",Z(22,Ri)),v("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),a("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Bi=({dt:n})=>`
|
|
2
2
|
.p-contextmenu {
|
|
3
3
|
position: absolute;
|
|
4
4
|
background: ${n("contextmenu.background")};
|
|
@@ -155,4 +155,4 @@ import{a as Ft}from"./chunk-XPCRS7AL.js";import{a as At,b as he}from"./chunk-MX5
|
|
|
155
155
|
margin-left: 0;
|
|
156
156
|
margin-right: auto;
|
|
157
157
|
}
|
|
158
|
-
`,zi={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:n,processedItem:p})=>["p-contextmenu-item",{"p-contextmenu-item-active":n.isItemActive(p),"p-focus":n.isItemFocused(p),"p-disabled":n.isItemDisabled(p)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},zt=(()=>{class n extends Dt{name="contextmenu";theme=Bi;classes=zi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=st(n)))(i||n)}})();static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})();var Hi=(()=>{class n extends Ye{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new L;itemMouseEnter=new L;menuFocus=new L;menuBlur=new L;menuKeydown=new L;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,t,i=null){return e&&e.item?We(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return O(D({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return O(D({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return V(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let t=e.parentElement.parentElement,i=kt(e.parentElement.parentElement),o=Ze(),s=e.offsetParent?e.offsetWidth:qe(e),g=bt(t.children[0]);e.style.top="0px",parseInt(i.left,10)+g+s>o.width-yt()?e.style.left=-1*s+"px":e.style.left=g+"px"}static \u0275fac=function(t){return new(t||n)(Ae(ot(()=>Fe)))};static \u0275cmp=C({type:n,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&G(ti,5),t&2){let o;w(o=P())&&(i.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",B],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",B],autoZIndex:[2,"autoZIndex","autoZIndex",B],baseZIndex:[2,"baseZIndex","baseZIndex",U],popup:[2,"popup","popup",B],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",U],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",U]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[$e],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(t,i){t&1&&f(0,Li,3,13,"ul",3),t&2&&a("ngIf",i.root?!0:i.visible)},dependencies:[n,T,Re,dt,Ne,ht,Be,ze,_t,Vt,Je,Lt,Ft,he,At,de],encapsulation:2,data:{animation:[je("overlayAnimation",[pe(":enter",[me({opacity:0})]),pe(":leave",[me({opacity:0})])])]}})}return n})(),Fe=(()=>{class n extends Ye{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new L;onHide=new L;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=I(!1);relativeAlign;window;focused=!1;activeItemPath=I([]);focusedItemInfo=I({index:-1,level:0,parentKey:"",item:null});submenuVisible=I(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=b(zt);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${V(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,ut(()=>{let t=this.activeItemPath();V(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||Pt("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return Tt()||St()}bindTriggerEventListener(){ce(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(ce(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,t=0,i={},o=""){let s=[];return e&&e.forEach((g,z)=>{let $=(o!==""?o+"_":"")+z,K={item:g,index:z,level:t,key:$,parent:i,parentKey:o};K.items=this.createProcessedItems(g.items,t+1,K,$),s.push(K)}),s}bindMatchMediaListener(){if(ce(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?We(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&V(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&V(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:s,key:g,level:z,parentKey:$,item:K}=t;this.activeItemPath.set(this.activeItemPath().filter(_e=>g!==_e.key&&g.startsWith(_e.key))),this.focusedItemInfo.set({index:s,level:z,parentKey:$,item:K}),Le(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&wt(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(g=>g.key===t.parentKey);Qe(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let s=this.activeItemPath().filter(g=>g.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(s),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(O(D({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=Ee(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&Ee(t,'a[data-pc-section="action"]');i?i.click():t&&t.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let g=this.focusedItemInfo();this.focusedItemInfo.set(O(D({},g),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:o}=e;if(Qe(i))return;let{index:s,key:g,level:z,parentKey:$,items:K}=i,_e=V(K),it=this.activeItemPath().filter(nt=>nt.parentKey!==$&&nt.parentKey!==g);_e&&(it.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:s,level:z,parentKey:$,item:i.item}),o&&Le(this.rootmenu.sublistViewChild.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(it)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),Le(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):vt(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&Xe.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&Xe.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:qe(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:Ct(this.containerViewChild.nativeElement),s=Ze();e+i-this.document.scrollingElement.scrollLeft>s.width&&(e-=i),t+o-this.document.scrollingElement.scrollTop>s.height&&(t-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(s=>this.isItemMatched(s)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(s=>this.isItemMatched(s)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(s=>this.isItemMatched(s)),i!==-1&&(o=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return V(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return Ue(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?Ue(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),o=this.focusedItemInfo();o.index!==t&&(this.focusedItemInfo.set(O(D({},o),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=Ee(this.rootmenu.el.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){ce(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):Mt(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(t){return new(t||n)(Ae(Ot))};static \u0275cmp=C({type:n,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,o){if(t&1&&(ge(o,Fi,4),ge(o,Vi,4),ge(o,Et,4)),t&2){let s;w(s=P())&&(i.itemTemplate=s.first),w(s=P())&&(i.submenuIconTemplate=s.first),w(s=P())&&(i.templates=s)}},viewQuery:function(t,i){if(t&1&&(G(Ai,5),G($i,5)),t&2){let o;w(o=P())&&(i.rootmenu=o.first),w(o=P())&&(i.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",B],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",B],baseZIndex:[2,"baseZIndex","baseZIndex",U],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",U]},outputs:{onShow:"onShow",onHide:"onHide"},features:[mt([zt]),$e],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(t,i){t&1&&f(0,Ni,4,23,"div",2),t&2&&a("ngIf",i.visible())},dependencies:[T,Re,Ne,Be,Hi,ze,Je,he,de],encapsulation:2,data:{animation:[je("overlayAnimation",[pe(":enter",[me({opacity:0}),Ge("250ms")]),pe(":leave",[Ge(".1s linear",me({opacity:0}))])])]},changeDetection:0})}return n})(),jt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=lt({type:n});static \u0275inj=rt({imports:[Fe,de,de]})}return n})();var Gi=["contextMenu"];function Zi(n,p){if(n&1){let e=k();l(0,"a",3),_("click",function(){let i=d(e).$implicit,o=r();return h(o.onClickContextMenuItem(i))}),y(1,"i"),l(2,"span",4),u(3),m()()}if(n&2){let e=p.$implicit;c(),N(e.icon),c(2),M(e.label)}}var Do=(()=>{class n{constructor(){this.items=j([]),this.onSelectItem=H()}show(e,t){clearTimeout(this.hoverTimeout),this.selectedData=null,this.hoverTimeout=setTimeout(()=>{this.contextMenuEl.show(e),this.selectedData=t},100)}hide(){this.contextMenuEl?.hide(),clearTimeout(this.hoverTimeout),this.selectedData=null}onClickContextMenuItem(e){this.onSelectItem.emit({item:e,data:this.selectedData})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-context-menu"]],viewQuery:function(t,i){if(t&1&&G(Gi,5),t&2){let o;w(o=P())&&(i.contextMenuEl=o.first)}},inputs:{items:[1,"items"]},outputs:{onSelectItem:"onSelectItem"},decls:4,vars:1,consts:[["contextMenu",""],["item",""],[3,"model"],["pRipple","",1,"flex","items-center","p-contextmenu-item-link",3,"click"],[1,"ml-2"]],template:function(t,i){t&1&&(l(0,"p-contextmenu",2,0),f(2,Zi,4,3,"ng-template",null,1,le),m()),t&2&&a("model",i.items())},dependencies:[F,jt,Fe,he],encapsulation:2})}}return n})();export{Zn as a,Do as b};
|
|
158
|
+
`,zi={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:n,processedItem:p})=>["p-contextmenu-item",{"p-contextmenu-item-active":n.isItemActive(p),"p-focus":n.isItemFocused(p),"p-disabled":n.isItemDisabled(p)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},zt=(()=>{class n extends Dt{name="contextmenu";theme=Bi;classes=zi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=st(n)))(i||n)}})();static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})();var Hi=(()=>{class n extends Ye{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new L;itemMouseEnter=new L;menuFocus=new L;menuBlur=new L;menuKeydown=new L;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,t,i=null){return e&&e.item?We(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return O(D({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return O(D({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return F(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let t=e.parentElement.parentElement,i=kt(e.parentElement.parentElement),o=Ze(),s=e.offsetParent?e.offsetWidth:qe(e),g=bt(t.children[0]);e.style.top="0px",parseInt(i.left,10)+g+s>o.width-yt()?e.style.left=-1*s+"px":e.style.left=g+"px"}static \u0275fac=function(t){return new(t||n)(Ae(ot(()=>Ve)))};static \u0275cmp=C({type:n,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&G(ti,5),t&2){let o;w(o=P())&&(i.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",B],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",B],autoZIndex:[2,"autoZIndex","autoZIndex",B],baseZIndex:[2,"baseZIndex","baseZIndex",U],popup:[2,"popup","popup",B],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",U],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",U]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[$e],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(t,i){t&1&&f(0,Li,3,13,"ul",3),t&2&&a("ngIf",i.root?!0:i.visible)},dependencies:[n,T,Re,dt,Ne,ht,Be,ze,_t,Ft,Je,Lt,Vt,he,At,de],encapsulation:2,data:{animation:[je("overlayAnimation",[pe(":enter",[me({opacity:0})]),pe(":leave",[me({opacity:0})])])]}})}return n})(),Ve=(()=>{class n extends Ye{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new L;onHide=new L;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=I(!1);relativeAlign;window;focused=!1;activeItemPath=I([]);focusedItemInfo=I({index:-1,level:0,parentKey:"",item:null});submenuVisible=I(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=b(zt);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${F(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,ut(()=>{let t=this.activeItemPath();F(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||Pt("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return Tt()||St()}bindTriggerEventListener(){ce(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(ce(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,t=0,i={},o=""){let s=[];return e&&e.forEach((g,z)=>{let $=(o!==""?o+"_":"")+z,K={item:g,index:z,level:t,key:$,parent:i,parentKey:o};K.items=this.createProcessedItems(g.items,t+1,K,$),s.push(K)}),s}bindMatchMediaListener(){if(ce(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?We(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&F(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&F(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:s,key:g,level:z,parentKey:$,item:K}=t;this.activeItemPath.set(this.activeItemPath().filter(_e=>g!==_e.key&&g.startsWith(_e.key))),this.focusedItemInfo.set({index:s,level:z,parentKey:$,item:K}),Le(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&wt(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(g=>g.key===t.parentKey);Qe(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let s=this.activeItemPath().filter(g=>g.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(s),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(O(D({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=Ee(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&Ee(t,'a[data-pc-section="action"]');i?i.click():t&&t.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let g=this.focusedItemInfo();this.focusedItemInfo.set(O(D({},g),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:o}=e;if(Qe(i))return;let{index:s,key:g,level:z,parentKey:$,items:K}=i,_e=F(K),it=this.activeItemPath().filter(nt=>nt.parentKey!==$&&nt.parentKey!==g);_e&&(it.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:s,level:z,parentKey:$,item:i.item}),o&&Le(this.rootmenu.sublistViewChild.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(it)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),Le(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):vt(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&Xe.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&Xe.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:qe(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:Ct(this.containerViewChild.nativeElement),s=Ze();e+i-this.document.scrollingElement.scrollLeft>s.width&&(e-=i),t+o-this.document.scrollingElement.scrollTop>s.height&&(t-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(s=>this.isItemMatched(s)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(s=>this.isItemMatched(s)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(s=>this.isItemMatched(s)),i!==-1&&(o=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return F(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return Ue(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?Ue(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),o=this.focusedItemInfo();o.index!==t&&(this.focusedItemInfo.set(O(D({},o),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=Ee(this.rootmenu.el.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){ce(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):Mt(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(t){return new(t||n)(Ae(Ot))};static \u0275cmp=C({type:n,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,o){if(t&1&&(ge(o,Vi,4),ge(o,Fi,4),ge(o,Et,4)),t&2){let s;w(s=P())&&(i.itemTemplate=s.first),w(s=P())&&(i.submenuIconTemplate=s.first),w(s=P())&&(i.templates=s)}},viewQuery:function(t,i){if(t&1&&(G(Ai,5),G($i,5)),t&2){let o;w(o=P())&&(i.rootmenu=o.first),w(o=P())&&(i.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",B],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",B],baseZIndex:[2,"baseZIndex","baseZIndex",U],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",U]},outputs:{onShow:"onShow",onHide:"onHide"},features:[mt([zt]),$e],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(t,i){t&1&&f(0,Ni,4,23,"div",2),t&2&&a("ngIf",i.visible())},dependencies:[T,Re,Ne,Be,Hi,ze,Je,he,de],encapsulation:2,data:{animation:[je("overlayAnimation",[pe(":enter",[me({opacity:0}),Ge("250ms")]),pe(":leave",[Ge(".1s linear",me({opacity:0}))])])]},changeDetection:0})}return n})(),jt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=lt({type:n});static \u0275inj=rt({imports:[Ve,de,de]})}return n})();var Gi=["contextMenu"];function Zi(n,p){if(n&1){let e=k();l(0,"a",3),_("click",function(){let i=d(e).$implicit,o=r();return h(o.onClickContextMenuItem(i))}),y(1,"i"),l(2,"span",4),u(3),m()()}if(n&2){let e=p.$implicit;c(),N(e.icon),c(2),M(e.label)}}var Do=(()=>{class n{constructor(){this.items=j([]),this.onSelectItem=H()}show(e,t){clearTimeout(this.hoverTimeout),this.selectedData=null,this.hoverTimeout=setTimeout(()=>{this.contextMenuEl.show(e),this.selectedData=t},100)}hide(){this.contextMenuEl?.hide(),clearTimeout(this.hoverTimeout),this.selectedData=null}onClickContextMenuItem(e){this.onSelectItem.emit({item:e,data:this.selectedData})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-context-menu"]],viewQuery:function(t,i){if(t&1&&G(Gi,5),t&2){let o;w(o=P())&&(i.contextMenuEl=o.first)}},inputs:{items:[1,"items"]},outputs:{onSelectItem:"onSelectItem"},decls:4,vars:1,consts:[["contextMenu",""],["item",""],[3,"model"],["pRipple","",1,"flex","items-center","p-contextmenu-item-link",3,"click"],[1,"ml-2"]],template:function(t,i){t&1&&(l(0,"p-contextmenu",2,0),f(2,Zi,4,3,"ng-template",null,1,le),m()),t&2&&a("model",i.items())},dependencies:[V,jt,Ve,he],encapsulation:2})}}return n})();export{Zn as a,Do as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ae}from"./chunk-OLANEXLB.js";import{a as oe,b as le}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{i as X}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as Q}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-PYXL7UF7.js";import{c as K}from"./chunk-RXQX7567.js";import{m as ne,n as ie}from"./chunk-HJXYT6MI.js";import{A as G,h as H,m as U}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as V,k as J,l as W,n as k}from"./chunk-FXQKRJWU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function pe(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function me(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function se(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,me,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function ce(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Fe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,pe,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,se,21,13,"div",8),m(13,"async"),u(14,ce,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,ae,le,oe,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Fe as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-HAJDTNAW.js";import"./chunk-ACIMXBIC.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as k,n as B}from"./chunk-HJXYT6MI.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as P,H as T,J as R,g as D,j as C,k as b,m as y,n as M}from"./chunk-FXQKRJWU.js";import{$c as c,Gb as h,Gc as n,Hc as d,Ic as _,Mb as s,Yb as m,aa as I,ad as E,bd as x,ic as i,jc as t,lc as f,mc as u,rb as o,uc as S,v as g,xb as v}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function N(a,p){if(a&1&&(i(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),n(9),t()()()()()()),a&2){let e=S().ngIf;o(9),d(e.Perflog)}}function L(a,p){if(a&1&&(f(0),i(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),n(5,"StackTrace"),t()(),i(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),n(10),t()()()()()(),u()),a&2){let e=S().ngIf;o(10),d(e==null?null:e.StackTrace)}}function A(a,p){if(a&1&&(f(0),i(1,"mainpanel",1)(2,"actions")(3,"a",2),n(4,"Back"),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),n(12,"General"),t()(),i(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),n(18,"Created Date"),t(),i(19,"div")(20,"span"),n(21),c(22,"date"),t()()()(),i(23,"div",10)(24,"div",11)(25,"label"),n(26,"Status"),t(),i(27,"div")(28,"span"),n(29),t()()()()(),i(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),n(34,"Duration"),t(),i(35,"div")(36,"span"),n(37),c(38,"number"),t()()()(),i(39,"div",10)(40,"div",11)(41,"label"),n(42,"Label"),t(),i(43,"div")(44,"span"),n(45),t()()()()()()()()(),i(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),n(51,"Message"),t()(),i(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),n(56),t()()()()()(),s(57,N,10,1,"div",16)(58,L,11,1,"ng-container",0),t()()()(),u()),a&2){let e=p.ngIf;o(),m("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(x(22,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",x(38,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m("ngIf",e==null?null:e.Perflog),o(),m("ngIf",e==null?null:e.StackTrace)}}var K=(()=>{class a{constructor(e,r){this.activatedRoute=e,this.notificationService=r}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(I(e=>{let r=e.ID;return this.notificationService.getNotificationDetail(r).pipe(g(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(r){return new(r||a)(v(P),v(w))}}static{this.\u0275cmp=h({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(r,l){r&1&&(s(0,A,59,16,"ng-container",0),c(1,"async")),r&2&&m("ngIf",E(1,1,l.notification$))},dependencies:[M,D,C,y,b,B,k,R,T],encapsulation:2})}}return a})();export{K as DetailComponent};
|