dealpos 25.31.0 → 25.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/browser/{chunk-P4FK7Z5U.js → chunk-2BIGSZO5.js} +1 -1
  2. package/browser/{chunk-2DSUXMRV.js → chunk-2VRY7O77.js} +1 -1
  3. package/browser/{chunk-DJDVYD6P.js → chunk-356IV4ZE.js} +1 -1
  4. package/browser/{chunk-J3O5BHB2.js → chunk-4F5WEZVF.js} +1 -1
  5. package/browser/{chunk-F3EZEQKJ.js → chunk-4GNV76N3.js} +1 -1
  6. package/browser/{chunk-J7PZTSPK.js → chunk-4KJRE3GP.js} +1 -1
  7. package/browser/{chunk-PG7OVG7B.js → chunk-4PC6PQ7Q.js} +1 -1
  8. package/browser/{chunk-W2U326WQ.js → chunk-4TP7S3U3.js} +1 -1
  9. package/browser/{chunk-LI3G6XVH.js → chunk-5233FXFY.js} +1 -1
  10. package/browser/{chunk-G3QUNMLW.js → chunk-5WBNHRSF.js} +1 -1
  11. package/browser/{chunk-RYFBIJBW.js → chunk-6BSPRF7M.js} +1 -1
  12. package/browser/{chunk-B6PO2SMO.js → chunk-6EI3EXE7.js} +1 -1
  13. package/browser/{chunk-36H32UHM.js → chunk-6HUVTRYH.js} +1 -1
  14. package/browser/{chunk-SXKEJJ7X.js → chunk-6IFNMT72.js} +1 -1
  15. package/browser/{chunk-POKWPMMW.js → chunk-6K77FOTH.js} +1 -1
  16. package/browser/{chunk-ZTAABUPH.js → chunk-74ZM5NHT.js} +1 -1
  17. package/browser/{chunk-JY6RWWQL.js → chunk-7MB4HURG.js} +1 -1
  18. package/browser/{chunk-AHJTCZJX.js → chunk-A2QB6KDW.js} +2 -2
  19. package/browser/{chunk-UICK73QL.js → chunk-AHKKBRLR.js} +2 -2
  20. package/browser/{chunk-TQZEUCAO.js → chunk-AWUM3KMS.js} +1 -1
  21. package/browser/{chunk-2SQ7MIH3.js → chunk-B7DKFLLG.js} +1 -1
  22. package/browser/{chunk-44PZNOSI.js → chunk-CY4FO26Z.js} +1 -1
  23. package/browser/{chunk-74HPFPSG.js → chunk-DMSBV63C.js} +1 -1
  24. package/browser/{chunk-XM4DGUKE.js → chunk-DX2NQ3TK.js} +1 -1
  25. package/browser/{chunk-KWJ35MIH.js → chunk-EWLYV6PD.js} +2 -2
  26. package/browser/{chunk-2TYLJYVP.js → chunk-HIUH7JJU.js} +1 -1
  27. package/browser/{chunk-OHW6ADB3.js → chunk-HR5WLTC4.js} +1 -1
  28. package/browser/{chunk-OHNREXII.js → chunk-IPTLWEIL.js} +1 -1
  29. package/browser/{chunk-VASGWT2Y.js → chunk-J4GCFDIV.js} +1 -1
  30. package/browser/{chunk-TSWDADFF.js → chunk-J6RZLLDH.js} +1 -1
  31. package/browser/{chunk-G4IBZOWA.js → chunk-JALOTTYL.js} +1 -1
  32. package/browser/{chunk-3HDQJYUV.js → chunk-JK75ENMS.js} +1 -1
  33. package/browser/{chunk-4L6JCYR5.js → chunk-K4YULPNU.js} +2 -2
  34. package/browser/{chunk-O4R2PXCK.js → chunk-L27WHOBJ.js} +1 -1
  35. package/browser/{chunk-PN3QIZQ5.js → chunk-LOHRG6CW.js} +1 -1
  36. package/browser/{chunk-DRXITZ6D.js → chunk-LWQAPXWM.js} +1 -1
  37. package/browser/{chunk-I5GUKU6V.js → chunk-MAFIFJSJ.js} +1 -1
  38. package/browser/{chunk-5CUULP4V.js → chunk-MGZYE4DB.js} +1 -1
  39. package/browser/{chunk-4PHMOCJI.js → chunk-MLQCCNEW.js} +2 -2
  40. package/browser/{chunk-BNDKRWDF.js → chunk-N27F227W.js} +1 -1
  41. package/browser/{chunk-KHUH7N3D.js → chunk-NARPOKGG.js} +1 -1
  42. package/browser/{chunk-GUTX2YJ3.js → chunk-NCR5B5Y4.js} +2 -2
  43. package/browser/{chunk-SIERVKA4.js → chunk-NRY2MTXW.js} +1 -1
  44. package/browser/{chunk-LBXZC5EZ.js → chunk-OBZMOT6W.js} +1 -1
  45. package/browser/{chunk-M3UQXSZG.js → chunk-OPOZFMCV.js} +1 -1
  46. package/browser/{chunk-AJLPCTQP.js → chunk-PXKTG2K3.js} +1 -1
  47. package/browser/{chunk-WIEZLOPZ.js → chunk-Q2ITLIW2.js} +1 -1
  48. package/browser/{chunk-QLBIOJGM.js → chunk-RGM2KZ5L.js} +1 -1
  49. package/browser/{chunk-RQMSV2NG.js → chunk-RVEF5C4M.js} +1 -1
  50. package/browser/{chunk-PH6OCZUI.js → chunk-S2MC4OUN.js} +1 -1
  51. package/browser/{chunk-E25ISMCV.js → chunk-SDGA5WRP.js} +1 -1
  52. package/browser/{chunk-S3THTBYH.js → chunk-SGTPMFH6.js} +1 -1
  53. package/browser/{chunk-445Z6XZP.js → chunk-SJHBFLM7.js} +1 -1
  54. package/browser/{chunk-D4JS2BCB.js → chunk-SMHJ3JIG.js} +1 -1
  55. package/browser/{chunk-N5NCEG3Q.js → chunk-TU4O6KBQ.js} +1 -1
  56. package/browser/{chunk-WFJOV35Q.js → chunk-UD4WWZOI.js} +1 -1
  57. package/browser/{chunk-7BAJOMR7.js → chunk-UHGOF24M.js} +1 -1
  58. package/browser/{chunk-A4OW2P7U.js → chunk-VIYE2OFI.js} +1 -1
  59. package/browser/{chunk-HFEUPDVD.js → chunk-W5PF5BAF.js} +1 -1
  60. package/browser/{chunk-KLTEF3B6.js → chunk-XETIOXLN.js} +1 -1
  61. package/browser/{chunk-62QZ64V3.js → chunk-XHBIIXPS.js} +1 -1
  62. package/browser/{chunk-A5GF4BGA.js → chunk-Y5HNNIJE.js} +1 -1
  63. package/browser/{chunk-HCFNUTHB.js → chunk-YU32SBPB.js} +1 -1
  64. package/browser/{chunk-7ECGSCQ5.js → chunk-YUROCGY4.js} +1 -1
  65. package/browser/{chunk-FLAFKYDL.js → chunk-ZAJCD6I2.js} +1 -1
  66. package/browser/{chunk-RI3MTWXE.js → chunk-ZESJJFN2.js} +1 -1
  67. package/browser/chunk-ZOSMCW2A.js +1 -0
  68. package/browser/{chunk-FBAQ5XLU.js → chunk-ZSUZVVVK.js} +1 -1
  69. package/browser/index.html +2 -2
  70. package/browser/{main-U255RM4T.js → main-2NK4AXEX.js} +2 -2
  71. package/package.json +1 -1
  72. package/browser/chunk-G42IY5XQ.js +0 -1
@@ -1,2 +1,2 @@
1
- import{P as b}from"./chunk-YJVLRBSS.js";import{a as m}from"./chunk-2FWFPV5I.js";import{a as u}from"./chunk-TSWDADFF.js";import{Td as d,Wd as h,ja as n,na as c}from"./chunk-EDB2BAIG.js";import{j as l}from"./chunk-7DCB7DB2.js";var p=class a{constructor(){}copy(t){return new Promise((o,r)=>{try{if(navigator.clipboard)navigator.clipboard.writeText(t).then(o,r);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?o():r(new Error("Failed to copy with execCommand"))}catch(i){r(i)}finally{document.body.removeChild(e)}}}catch(e){r(e)}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};var y=class a{toastr=c(d);httpService=c(h);copyToClipBoard=c(p);createCustomerFromNewNumberAndSendReceipt(t,o,r,e,i){r==0?this.httpService.post(b.CreateCustomerInvoice,{InvoiceID:e.ObjectID,Mobile:t}).subscribe(s=>l(this,null,function*(){this.toastr.success(s.Message,m.Success),yield this.sendReceiptToWhatsapp(t,e,o,i)})):this.toastr.info("WABA is not supported yet",m.Info)}createWhatsappReceipt(t,o,r){let e=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],i=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:g,InvoiceNumber:f}=t,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:e(g),Brand:i,Currency:o,Number:f,ReceiptLink:w},r)}convertWhatsappTemplateMessage(t,o){let r=o||u?.whatsappTemplateMessage,e=["Brand","Number","Currency","Amount","ReceiptLink"],i=r;return e.forEach(s=>i=i.replace(`{${s}}`,t[s])),i}redirectToWhatsapp(t,o){let r=t;r=r[0]==="0"?`62${r.slice(1)}`:r;let e=`whatsapp://send?phone=${r}&text=${encodeURIComponent(o)}`;window.location.href=e,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let t=!1;window.onblur=function(){t=!0},setTimeout(()=>{t||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
1
+ import{P as b}from"./chunk-YJVLRBSS.js";import{a as m}from"./chunk-2FWFPV5I.js";import{a as u}from"./chunk-J6RZLLDH.js";import{Td as d,Wd as h,ja as n,na as c}from"./chunk-EDB2BAIG.js";import{j as l}from"./chunk-7DCB7DB2.js";var p=class a{constructor(){}copy(t){return new Promise((o,r)=>{try{if(navigator.clipboard)navigator.clipboard.writeText(t).then(o,r);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?o():r(new Error("Failed to copy with execCommand"))}catch(i){r(i)}finally{document.body.removeChild(e)}}}catch(e){r(e)}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};var y=class a{toastr=c(d);httpService=c(h);copyToClipBoard=c(p);createCustomerFromNewNumberAndSendReceipt(t,o,r,e,i){r==0?this.httpService.post(b.CreateCustomerInvoice,{InvoiceID:e.ObjectID,Mobile:t}).subscribe(s=>l(this,null,function*(){this.toastr.success(s.Message,m.Success),yield this.sendReceiptToWhatsapp(t,e,o,i)})):this.toastr.info("WABA is not supported yet",m.Info)}createWhatsappReceipt(t,o,r){let e=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],i=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:g,InvoiceNumber:f}=t,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:e(g),Brand:i,Currency:o,Number:f,ReceiptLink:w},r)}convertWhatsappTemplateMessage(t,o){let r=o||u?.whatsappTemplateMessage,e=["Brand","Number","Currency","Amount","ReceiptLink"],i=r;return e.forEach(s=>i=i.replace(`{${s}}`,t[s])),i}redirectToWhatsapp(t,o){let r=t;r=r[0]==="0"?`62${r.slice(1)}`:r;let e=`whatsapp://send?phone=${r}&text=${encodeURIComponent(o)}`;window.location.href=e,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let t=!1;window.onblur=function(){t=!0},setTimeout(()=>{t||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
2
2
  `,"WhatsApp not installed")},2e3)}copyToClipboard(t){return new Promise((o,r)=>this.copyToClipBoard.copy(t).then(()=>{this.toastr.info("Message copied to clipboard. If WhatsApp doesn't show the message, please paste it manually.","Receipt Ready",{timeOut:8e3}),o("Copied to clipboard")}).catch(e=>{console.log(e),this.toastr.warning("Could not copy message to clipboard","Clipboard Error",{timeOut:8e3}),r(e)}))}sendReceiptToWhatsapp(t,o,r,e){return l(this,null,function*(){try{let i=this.createWhatsappReceipt(o,r,e);try{yield this.copyToClipboard(i)}finally{this.redirectToWhatsapp(t,i)}}catch(i){console.warn(i),this.toastr.error("Failed to send receipt")}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac})};export{p as a,y as b};
@@ -1 +1 @@
1
- import{a as Ce}from"./chunk-3HDQJYUV.js";import{a as Me}from"./chunk-63P7EQO4.js";import{a as Pe}from"./chunk-2SQ7MIH3.js";import{a as ve}from"./chunk-XUP2FY5D.js";import{ga as be,ha as Se}from"./chunk-JLOQTYOI.js";import{a as ue}from"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import{D as he,b as de,h as me,o as fe}from"./chunk-LNLGRZBB.js";import{a as T,c as h}from"./chunk-74HPFPSG.js";import{a as ge}from"./chunk-I5GUKU6V.js";import{a as M,d as I}from"./chunk-MP62IGYR.js";import{a as ce}from"./chunk-TSWDADFF.js";import{$ as H,$a as c,E,Ib as o,Jb as s,Kb as p,Ld as oe,Nd as ae,Od as b,Pd as se,Qb as C,Qd as le,Rb as Q,Rd as B,Td as pe,Uc as ie,Vb as Z,Wa as J,Wc as ne,d as G,da as D,db as v,ec as m,fc as V,gc as $,hd as re,ja as d,ka as y,kb as q,lb as x,ma as _,na as l,pc as K,qb as j,qc as X,ub as Y,vb as f,xb as W,xc as ee,zb as F,zc as te}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";var r=class e{constructor(i,t){this.authService=i;this.router=t}canLoad(i,t){return this.authService.isTokenExpired()?(this.authService.returnUrl=this.getUrlRedirect(t),this.router.navigate(["/"]),!1):!0}getUrlRedirect(i){let t="/menu";i.forEach(a=>t+=`/${a.path}`);let n=this.router.getCurrentNavigation().extractedUrl.queryParams;return Object.keys(n).forEach((a,g)=>{g==0?t=`${t}?${a}=${n[a]}`:t=`${t}&${a}=${n[a]}`}),t}static \u0275fac=function(t){return new(t||e)(_(h),_(b))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var w=class e{constructor(i){this.toastrService=i;this.initPermissionToastr=!1}isPermissionGranted;initPermissionToastr;initPermission(){try{this.initPermissionToastr||Notification.requestPermission().then(t=>{this.isPermissionGranted=!1,t=="granted"&&(this.isPermissionGranted=!0),this.initPermissionToastr=!0})}catch(i){console.error(i)}}showAlert(i,t,n,u){let a=6e4;if(this.isPermissionGranted)try{let g=new Notification(t,{body:i,icon:u});g.onerror=R=>{this.toastrService.info(this.setBody(i,n),t,{timeOut:a,enableHtml:this.hasUrl(n)})}}catch(g){console.error(g)}else this.toastrService.info(this.setBody(i,n),t,{timeOut:a,enableHtml:this.hasUrl(n)})}setBody(i,t){return this.hasUrl(t)&&(i=`<a href="${t}" target="_blank" class="ps-0">${i}</a>`),i}hasUrl(i){return!!(i&&i.length!==0)}static \u0275fac=function(t){return new(t||e)(_(pe))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var _e=[{T:"Dashboard",U:"/menu/Dashboard",I:"fa-solid fa-chart-pie"},{T:"Products",U:"/menu/Products",I:"fa-solid fa-tag"},{T:"Estimate",U:"/menu/Estimate",I:"fa-solid fa-clipboard"},{T:"Sell",U:"/menu/Sell",I:"fa-solid fa-cart-shopping"},{T:"Shift",U:"/menu/Shift/",I:"fa-solid fa-user-clock"},{T:"Reports",U:"/menu/Reports",I:"fa-solid fa-chart-area"},{T:"Contacts",U:"/menu/Contacts",I:"fas fa-address-book"},{T:"Orders",U:"/menu/Orders",I:"fas fa-file-invoice"},{T:"Payment",U:"/menu/Payment",I:"fas fa-money-bill-alt"},{T:"Debt",U:"/menu/Debt",I:"fas fa-dollar-sign"},{T:"Inventory",U:"/menu/Inventory",I:"fas fa-archive"},{T:"Adjustment",U:"/menu/Adjustment",I:"fas fa-scanner-gun"},{T:"Buy",U:"/menu/Buy",I:"fa-solid fa-cart-arrow-down"},{T:"Logistics",U:"/menu/Logistics",I:"fas fa-truck"},{T:"Fulfillment",U:"/menu/Fulfillment",I:"fas fa-dolly"},{T:"Manufacture",U:"/menu/Manufacture",I:"fas fa-industry"},{T:"Prepaid Package",U:"/menu/Prepaid_Package",I:"fa-solid fa-id-card"},{T:"Promotion",U:"/menu/Promotion",I:"fas fa-bullhorn"},{T:"Users",U:"/menu/Users",I:"fas fa-user"},{T:"Outlets",U:"/menu/Outlets",I:"fas fa-map-marker-alt"},{T:"Setup",U:"/menu/Setup",I:"fas fa-gear"},{T:"Developer",U:"/menu/Developer",I:"fas fa-code"}];var k=class e{role=l(I);authService=l(h);menu=_e;filteredMenu=[];initFilteredMenu(){this.filteredMenu=this.menu.filter(i=>i.T==="Dashboard"?this.role.dashboard.View:i.T==="Products"?this.role.product.View:i.T==="Estimate"?this.role.estimate.Create:i.T==="Sell"?this.role.sell.Create:i.T==="Shift"?this.role.sell.Create:i.T==="Reports"?this.role.report.View:i.T==="Contacts"?this.role.contact.View:i.T==="Orders"?this.role.order.View:i.T==="Payment"?this.role.payment.View:i.T==="Debt"?this.role.debt.View:i.T==="Inventory"?this.role.inventory.View:i.T==="Adjustment"?this.role.adjustment.View:i.T==="Buy"?this.role.buy.Create:i.T==="Logistics"?this.role.logistic.View:i.T==="Manufacture"?this.role.manufacture.View:i.T==="Fulfillment"?this.role.fulfillment.View:i.T==="Prepaid Package"?this.role.prepaidPackage.View:i.T==="Promotion"?this.role.promotion.View:i.T==="Users"?this.role.users.View:i.T==="Outlets"?this.role.outlets.View:i.T==="Setup"?this.role.setup.View:i.T==="Developer"?this.role.developer.View:!0),this.filterBySubscriptionStatus()}filterBySubscriptionStatus(){let i=this.authService.getSubscriptionStatus();this.filteredMenu=this.filteredMenu.filter(t=>{switch(i){case 2:return t.T=="Sell"||t.T=="Shift";case 3:return!1;default:return!0}})}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Oe=[{T:"My Profile",U:"Profile/Main/My_Profile",I:"fas fa-user"},{T:"My Subscription",U:"Profile/Main/My_Subscription",I:"fa-solid fa-credit-card"},{T:"Notification",U:"Profile/Notification/Push",I:"fas fa-bell"},{T:"My Sales",U:"Profile/Main/My_Sales",I:"fas fa-history"}];var A=class e{role=l(I);authService=l(h);filteredMenu=[];initFilteredMenu(){let i=this.authService.getSubscriptionStatus();this.filteredMenu=Oe.filter(t=>t.T=="My Profile"?this.role.profile.View:t.T=="My Subscription"?this.role.profile.Subscription:t.T=="Notification"?this.role.profile.Notification&&i!=2&&i!=3:t.T=="My Sales"?i!=2&&i!=3:!0)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=(e,i)=>({"full-container":e,"subscription-bar-visible":i}),Ue=e=>[e];function Ne(e,i){if(e&1&&(o(0,"a",35),p(1,"i",36),o(2,"span"),m(3),s()()),e&2){let t=i.$implicit;f("routerLink",t==null?null:t.U),c(),F((t==null?null:t.I)+" me-2"),c(2),V(t==null?null:t.T)}}function Re(e,i){if(e&1&&(o(0,"li",37,0)(2,"a",38),p(3,"i"),o(4,"p"),m(5),s()()()),e&2){let t=i.$implicit,n=Q();f("routerLinkActiveOptions",n.isActiveMatchOptions),Y("data-cy",t==null?null:t.T),c(2),f("matTooltip",n.toggleSideMenu?t==null?null:t.T:"")("routerLink",K(7,Ue,t==null?null:t.U)),c(),F(t==null?null:t.I),c(2),V(t==null?null:t.T)}}var P=class e{constructor(i,t,n,u,a,g,R,z){this.toggleSidebar=i;this.signalRClientService=t;this.notificationAlertService=n;this.router=u;this.authService=a;this.intercomService=g;R.initFilteredMenu(),z.initFilteredMenu(),this.leftSidebarMenu=R.filteredMenu,this.topMenu=z.filteredMenu,this.accountInfo=JSON.parse(localStorage.getItem("AccountInfo")),this.toggleSidebar.toggleState$.subscribe(xe=>this.isNavOpen=xe),this.destroy$=new G,this.initNotificationPermission()}isActiveMatchOptions={matrixParams:"subset",queryParams:"subset",paths:"subset",fragment:"exact"};toggleSideMenu=!1;isNavOpen;destroy$;activeMenu;appVersion=ce.version;currentSubStatus;subsStatusEnum=T;isFullContainer=!1;isHideIntercomLauncher;leftSidebarMenu;topMenu;accountInfo;ngOnInit(){this.subscribeToPushNotification(),this.getCurrentSubscriptionStatus(),this.initFullContainer()}initFullContainer(){this.router.events.pipe(E(i=>i instanceof oe),H(null),D(this.destroy$)).subscribe(i=>{this.isFullContainer=!1,(this.router.url.includes("Sell")&&!this.router.url.includes("v2")&&!this.router.url.includes("Offline")||this.router.url.includes("Buy")||this.router.url.includes("menu/Estimate")||this.router.url.includes("Transfer_Order/Form")||this.router.url.includes("Adjustment/Archive/Form")||this.router.url.includes("Job_Order/Archive/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Invoice/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Bill/New_Join_Bill"))&&(this.isFullContainer=!0)})}initNotificationPermission(){this.notificationAlertService.initPermission()}getCurrentSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus()}subscribeToPushNotification(){let i=localStorage.getItem("NotificationOutletID");M.IsNotEmpty(i)&&M.isGuid(i)?this.signalRClientService.SubscribeGroup(i):this.signalRClientService.startConnection(),this.signalRClientService.OnReceivePushNotification.pipe(D(this.destroy$),E(t=>M.IsNotEmpty(t))).subscribe(t=>{if(M.IsNotEmpty(t)){let n=JSON.parse(t),u="//res.cloudinary.com/pos/image/upload/v1657006791/icons/info-new.png";M.IsNotEmpty(n.Icon)&&(u=n.Icon),this.notificationAlertService.showAlert(n.Body,n.Header,n.URL,u)}})}ngAfterViewInit(){this.intercomService.inititalizeIntercom()}toggleMenu(){this.toggleSideMenu=!this.toggleSideMenu}logout(){this.authService.logout()}isNotEmpty(i){return M.IsNotEmpty(i)}onShowDropdown(){this.isHideIntercomLauncher=this.intercomService.isHideLauncher()}chatToggleChange(){this.isHideIntercomLauncher==!1?this.intercomService.hideLauncher():this.intercomService.showLauncher(),this.onShowDropdown()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(t){return new(t||e)(v(ve),v(ue),v(w),v(b),v(h),v(ge),v(k),v(A))};static \u0275cmp=q({type:e,selectors:[["POS-menu-master"]],standalone:!1,decls:52,vars:19,consts:[["rla","routerLinkActive"],[1,"wrapper"],["data-color","blue",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-lg-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fa-solid",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-cy","companyName","data-bs-toggle","dropdown","aria-expanded","false","matTooltipPosition","above",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center",2,"cursor","pointer",3,"click","matTooltip"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["class","dropdown-item h5",3,"routerLink",4,"ngFor","ngForOf"],[1,"dropdown-item","h5",2,"cursor","pointer"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-comment-dots","me-2"],[1,"checkbox_toggle","ms-3",3,"click"],["type","checkbox","id","chatToggle","name","ChatToggle",3,"ngModelChange","ngModel"],["for","chatToggle",1,"position-relative","rounded-pill","pointer"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-sign-out-alt","me-2"],[1,"divider"],[1,"dropdown-header","border-top"],["target","_blank",1,"dropdown-item","h5","changelog",3,"href"],["aria-hidden","true",1,"fa-solid","fa-sparkles","me-2"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],["target","_blank","href","http://support.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-book","me-2"],["target","_blank","href","https://www.dealpos.app/",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-table-cells-large","me-2"],["target","_blank","href","http://blog.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-brands","fa-blogger","me-2"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",3,"routerLinkActiveOptions",4,"ngFor","ngForOf"],["id","full-container",1,"main-panel",3,"ngClass"],[1,"dropdown-item","h5",3,"routerLink"],["aria-hidden","true"],["routerLinkActive","active",3,"routerLinkActiveOptions"],["matTooltipPosition","above",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(t,n){t&1&&(o(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){return n.toggleMenu()}),p(3,"i",4),s(),o(4,"div",5)(5,"div",6)(6,"a",7),C("click",function(){return n.onShowDropdown()}),m(7),ee(8,"limitText"),s(),o(9,"div",8)(10,"div",9),m(11),s(),p(12,"div",10),j(13,Ne,4,4,"a",11),o(14,"a",12)(15,"div",13)(16,"div"),p(17,"i",14),o(18,"span"),m(19,"Chat Support"),s()(),o(20,"div",15),C("click",function(a){return a.stopPropagation()}),o(21,"input",16),C("ngModelChange",function(){return n.chatToggleChange()}),s(),p(22,"label",17),s()()(),o(23,"a",18),C("click",function(){return n.logout()}),p(24,"i",19),o(25,"span"),m(26,"Log Out"),s()(),p(27,"div",20),o(28,"div",21),m(29," Links "),s(),o(30,"a",22),p(31,"i",23),o(32,"span"),m(33,"What's New"),p(34,"i",24),s()(),o(35,"a",25),p(36,"i",26),o(37,"span"),m(38,"Help Center"),s()(),o(39,"a",27),p(40,"i",28),o(41,"span"),m(42,"App Store"),s()(),o(43,"a",29),p(44,"i",30),o(45,"span"),m(46,"Company Blog"),s()()()()(),o(47,"div",31)(48,"ul",32),j(49,Re,6,9,"li",33),s()()(),o(50,"div",34),p(51,"router-outlet"),s()()),t&2&&(W("nav-open",n.isNavOpen),c(),f("ngClass",n.toggleSideMenu?"collapses":""),c(2),f("ngClass",n.toggleSideMenu?"fa-angle-left cursor":"fa-angle-right cursor"),c(3),f("matTooltip",n.accountInfo==null?null:n.accountInfo.BrandName),c(),$(" ",te(8,13,n.accountInfo==null?null:n.accountInfo.BrandName,12)," "),c(4),$("",n.accountInfo==null?null:n.accountInfo.UserName," "),c(2),f("ngForOf",n.topMenu),c(8),f("ngModel",!n.isHideIntercomLauncher),c(9),Z("href","https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=",n.appVersion,"",J),c(19),f("ngForOf",n.leftSidebarMenu),c(),f("ngClass",X(16,Le,n.isFullContainer,n.isNotEmpty(n.currentSubStatus)&&n.currentSubStatus!==n.subsStatusEnum.PAID)))},dependencies:[be,ae,se,le,de,me,fe,ie,ne,Me],styles:['.sidebar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%], body[_ngcontent-%COMP%] > .navbar-collapse[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important}.sidebar-wrapper[_ngcontent-%COMP%]{max-height:calc(100% - 61px)!important;min-height:calc(100% - 61px)!important}@media (max-width: 991px){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (pointer: coarse){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}}.full-container[_ngcontent-%COMP%]{padding-top:0!important}.changelog[_ngcontent-%COMP%]{color:#0006b1!important}.changelog[_ngcontent-%COMP%]:visited{color:#2e2e2e!important}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited:hover span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e9ecef!important;position:absolute;top:-4px;right:-18px}.subscription-bar-visible[_ngcontent-%COMP%]{padding-top:98px}.checkbox_toggle[_ngcontent-%COMP%]{position:relative}.checkbox_toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#868686;display:inline-block;padding-right:38px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:23px;height:14px;background-color:#ccc;top:2.2px;right:0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background-color:#1f77d0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{left:10px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:after{content:"";width:12px;height:12px;border-radius:50%;position:absolute;top:.8px;left:1px;transition:all .1s;background-color:#fff}']})};function Ee(e){let i=l(b),t="/menu";e.forEach(a=>t+=`/${a.path}`);let n=i.getCurrentNavigation().extractedUrl.queryParams;return Object.keys(n).forEach((a,g)=>{g==0?t=`${t}?${a}=${n[a]}`:t=`${t}&${a}=${n[a]}`}),t}var O=(e,i)=>{let t=l(h),n=t.isTokenExpired(),u=l(b);return n?(t.returnUrl=Ee(i),u.navigate(["/"]),!1):e.path=="Dashboard"?De():!0};function De(){let e=l(b),i=l(h),t=!1,n=i.getRedirectUrl();return t=n.includes("Dashboard"),t==!1&&e.navigate([n]),t}var L=class e{paymentStorageService=l(Ce);canActivate(i,t){return this.paymentStorageService.clear(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var U=class e{reportService=l(Pe);canActivate(i,t){return this.reportService.resetFilter(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var je=[{path:"",component:P,children:[{path:"Inventory",loadChildren:()=>import("./chunk-G4IBZOWA.js").then(e=>e.InventoryModule),canLoad:[r]},{path:"Reports",loadChildren:()=>import("./chunk-G3QUNMLW.js").then(e=>e.ReportsModule),canLoad:[r],canActivate:[U]},{path:"Sell",loadChildren:()=>import("./chunk-GUTX2YJ3.js").then(e=>e.routes),canLoad:[r]},{path:"Print",loadChildren:()=>import("./chunk-JZEWRW27.js").then(e=>e.PrintModule),canLoad:[r]},{path:"Buy",loadComponent:()=>import("./chunk-5CUULP4V.js").then(e=>e.BuyV2Component),canMatch:[O]},{path:"Sell/V2",loadComponent:()=>import("./chunk-KLTEF3B6.js").then(e=>e.SellV2Component),canMatch:[O]},{path:"Dashboard",loadComponent:()=>import("./chunk-LBXZC5EZ.js").then(e=>e.DashboardV2Component),canMatch:[O]},{path:"Products",loadChildren:()=>import("./chunk-BNDKRWDF.js").then(e=>e.ProductModule),canLoad:[r]},{path:"Shift",loadChildren:()=>import("./chunk-HFEUPDVD.js").then(e=>e.ShiftModule),canLoad:[r]},{path:"Debt",loadChildren:()=>import("./chunk-A4OW2P7U.js").then(e=>e.DebtModule),canLoad:[r]},{path:"Logistics",loadChildren:()=>import("./chunk-UICK73QL.js").then(e=>e.DeliveryModule),canLoad:[r]},{path:"Users",loadChildren:()=>import("./chunk-DRXITZ6D.js").then(e=>e.UsersModule),canLoad:[r]},{path:"Setup",loadChildren:()=>import("./chunk-4L6JCYR5.js").then(e=>e.SetupModule),canLoad:[r]},{path:"Developer",loadChildren:()=>import("./chunk-J3O5BHB2.js").then(e=>e.DeveloperModule),canLoad:[r]},{path:"Contacts",loadChildren:()=>import("./chunk-JY6RWWQL.js").then(e=>e.ContactsModule),canLoad:[r]},{path:"Outlets",loadChildren:()=>import("./chunk-KWJ35MIH.js").then(e=>e.OutletsModule),canLoad:[r]},{path:"Orders",loadChildren:()=>import("./chunk-4PHMOCJI.js").then(e=>e.OrdersModule),canLoad:[r]},{path:"Profile",loadChildren:()=>import("./chunk-A5GF4BGA.js").then(e=>e.ProfileModule),canLoad:[r]},{path:"Estimate",loadComponent:()=>import("./chunk-P4FK7Z5U.js").then(e=>e.EstimateV2Component),canMatch:[O]},{path:"Adjustment",loadChildren:()=>import("./chunk-OHNREXII.js").then(e=>e.AdjustmentModule),canLoad:[r]},{path:"Payment",loadChildren:()=>import("./chunk-E25ISMCV.js").then(e=>e.PaymentModule),canLoad:[r],canActivate:[L]},{path:"Promotion",loadChildren:()=>import("./chunk-D4JS2BCB.js").then(e=>e.PromotionModule),canLoad:[r]},{path:"Manufacture",loadChildren:()=>import("./chunk-AHJTCZJX.js").then(e=>e.ManufactureModule),canLoad:[r]},{path:"Prepaid_Package",loadChildren:()=>import("./chunk-KHUH7N3D.js").then(e=>e.PrepaidPackageModule),canLoad:[r]},{path:"Fulfillment",loadChildren:()=>import("./chunk-W2U326WQ.js").then(e=>e.FulfillmentModule),canLoad:[r]},{path:"Unauthorized",loadChildren:()=>import("./chunk-PG7OVG7B.js").then(e=>e.UnauthorizedModule),canLoad:[r]},{path:"Not_Found",loadChildren:()=>import("./chunk-DJDVYD6P.js").then(e=>e.NotFoundModule),canLoad:[r]},{path:"",redirectTo:"/menu/Dashboard",pathMatch:"full"},{path:"**",redirectTo:"Not_Found"}]}],N=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e});static \u0275inj=y({imports:[B.forChild(je),B]})};var ye=class e{constructor(){}static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e,bootstrap:[P]});static \u0275inj=y({imports:[Se,N,he,re]})};export{ye as MenuMasterModule};
1
+ import{a as Ce}from"./chunk-JK75ENMS.js";import{a as Me}from"./chunk-63P7EQO4.js";import{a as Pe}from"./chunk-B7DKFLLG.js";import{a as ve}from"./chunk-XUP2FY5D.js";import{ga as be,ha as Se}from"./chunk-JLOQTYOI.js";import{a as ue}from"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import{D as he,b as de,h as me,o as fe}from"./chunk-LNLGRZBB.js";import{a as T,c as h}from"./chunk-DMSBV63C.js";import{a as ge}from"./chunk-MAFIFJSJ.js";import{a as M,d as I}from"./chunk-MP62IGYR.js";import{a as ce}from"./chunk-J6RZLLDH.js";import{$ as H,$a as c,E,Ib as o,Jb as s,Kb as p,Ld as oe,Nd as ae,Od as b,Pd as se,Qb as C,Qd as le,Rb as Q,Rd as B,Td as pe,Uc as ie,Vb as Z,Wa as J,Wc as ne,d as G,da as D,db as v,ec as m,fc as V,gc as $,hd as re,ja as d,ka as y,kb as q,lb as x,ma as _,na as l,pc as K,qb as j,qc as X,ub as Y,vb as f,xb as W,xc as ee,zb as F,zc as te}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";var r=class e{constructor(i,t){this.authService=i;this.router=t}canLoad(i,t){return this.authService.isTokenExpired()?(this.authService.returnUrl=this.getUrlRedirect(t),this.router.navigate(["/"]),!1):!0}getUrlRedirect(i){let t="/menu";i.forEach(a=>t+=`/${a.path}`);let n=this.router.getCurrentNavigation().extractedUrl.queryParams;return Object.keys(n).forEach((a,g)=>{g==0?t=`${t}?${a}=${n[a]}`:t=`${t}&${a}=${n[a]}`}),t}static \u0275fac=function(t){return new(t||e)(_(h),_(b))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var w=class e{constructor(i){this.toastrService=i;this.initPermissionToastr=!1}isPermissionGranted;initPermissionToastr;initPermission(){try{this.initPermissionToastr||Notification.requestPermission().then(t=>{this.isPermissionGranted=!1,t=="granted"&&(this.isPermissionGranted=!0),this.initPermissionToastr=!0})}catch(i){console.error(i)}}showAlert(i,t,n,u){let a=6e4;if(this.isPermissionGranted)try{let g=new Notification(t,{body:i,icon:u});g.onerror=R=>{this.toastrService.info(this.setBody(i,n),t,{timeOut:a,enableHtml:this.hasUrl(n)})}}catch(g){console.error(g)}else this.toastrService.info(this.setBody(i,n),t,{timeOut:a,enableHtml:this.hasUrl(n)})}setBody(i,t){return this.hasUrl(t)&&(i=`<a href="${t}" target="_blank" class="ps-0">${i}</a>`),i}hasUrl(i){return!!(i&&i.length!==0)}static \u0275fac=function(t){return new(t||e)(_(pe))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var _e=[{T:"Dashboard",U:"/menu/Dashboard",I:"fa-solid fa-chart-pie"},{T:"Products",U:"/menu/Products",I:"fa-solid fa-tag"},{T:"Estimate",U:"/menu/Estimate",I:"fa-solid fa-clipboard"},{T:"Sell",U:"/menu/Sell",I:"fa-solid fa-cart-shopping"},{T:"Shift",U:"/menu/Shift/",I:"fa-solid fa-user-clock"},{T:"Reports",U:"/menu/Reports",I:"fa-solid fa-chart-area"},{T:"Contacts",U:"/menu/Contacts",I:"fas fa-address-book"},{T:"Orders",U:"/menu/Orders",I:"fas fa-file-invoice"},{T:"Payment",U:"/menu/Payment",I:"fas fa-money-bill-alt"},{T:"Debt",U:"/menu/Debt",I:"fas fa-dollar-sign"},{T:"Inventory",U:"/menu/Inventory",I:"fas fa-archive"},{T:"Adjustment",U:"/menu/Adjustment",I:"fas fa-scanner-gun"},{T:"Buy",U:"/menu/Buy",I:"fa-solid fa-cart-arrow-down"},{T:"Logistics",U:"/menu/Logistics",I:"fas fa-truck"},{T:"Fulfillment",U:"/menu/Fulfillment",I:"fas fa-dolly"},{T:"Manufacture",U:"/menu/Manufacture",I:"fas fa-industry"},{T:"Prepaid Package",U:"/menu/Prepaid_Package",I:"fa-solid fa-id-card"},{T:"Promotion",U:"/menu/Promotion",I:"fas fa-bullhorn"},{T:"Users",U:"/menu/Users",I:"fas fa-user"},{T:"Outlets",U:"/menu/Outlets",I:"fas fa-map-marker-alt"},{T:"Setup",U:"/menu/Setup",I:"fas fa-gear"},{T:"Developer",U:"/menu/Developer",I:"fas fa-code"}];var k=class e{role=l(I);authService=l(h);menu=_e;filteredMenu=[];initFilteredMenu(){this.filteredMenu=this.menu.filter(i=>i.T==="Dashboard"?this.role.dashboard.View:i.T==="Products"?this.role.product.View:i.T==="Estimate"?this.role.estimate.Create:i.T==="Sell"?this.role.sell.Create:i.T==="Shift"?this.role.sell.Create:i.T==="Reports"?this.role.report.View:i.T==="Contacts"?this.role.contact.View:i.T==="Orders"?this.role.order.View:i.T==="Payment"?this.role.payment.View:i.T==="Debt"?this.role.debt.View:i.T==="Inventory"?this.role.inventory.View:i.T==="Adjustment"?this.role.adjustment.View:i.T==="Buy"?this.role.buy.Create:i.T==="Logistics"?this.role.logistic.View:i.T==="Manufacture"?this.role.manufacture.View:i.T==="Fulfillment"?this.role.fulfillment.View:i.T==="Prepaid Package"?this.role.prepaidPackage.View:i.T==="Promotion"?this.role.promotion.View:i.T==="Users"?this.role.users.View:i.T==="Outlets"?this.role.outlets.View:i.T==="Setup"?this.role.setup.View:i.T==="Developer"?this.role.developer.View:!0),this.filterBySubscriptionStatus()}filterBySubscriptionStatus(){let i=this.authService.getSubscriptionStatus();this.filteredMenu=this.filteredMenu.filter(t=>{switch(i){case 2:return t.T=="Sell"||t.T=="Shift";case 3:return!1;default:return!0}})}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Oe=[{T:"My Profile",U:"Profile/Main/My_Profile",I:"fas fa-user"},{T:"My Subscription",U:"Profile/Main/My_Subscription",I:"fa-solid fa-credit-card"},{T:"Notification",U:"Profile/Notification/Push",I:"fas fa-bell"},{T:"My Sales",U:"Profile/Main/My_Sales",I:"fas fa-history"}];var A=class e{role=l(I);authService=l(h);filteredMenu=[];initFilteredMenu(){let i=this.authService.getSubscriptionStatus();this.filteredMenu=Oe.filter(t=>t.T=="My Profile"?this.role.profile.View:t.T=="My Subscription"?this.role.profile.Subscription:t.T=="Notification"?this.role.profile.Notification&&i!=2&&i!=3:t.T=="My Sales"?i!=2&&i!=3:!0)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=(e,i)=>({"full-container":e,"subscription-bar-visible":i}),Ue=e=>[e];function Ne(e,i){if(e&1&&(o(0,"a",35),p(1,"i",36),o(2,"span"),m(3),s()()),e&2){let t=i.$implicit;f("routerLink",t==null?null:t.U),c(),F((t==null?null:t.I)+" me-2"),c(2),V(t==null?null:t.T)}}function Re(e,i){if(e&1&&(o(0,"li",37,0)(2,"a",38),p(3,"i"),o(4,"p"),m(5),s()()()),e&2){let t=i.$implicit,n=Q();f("routerLinkActiveOptions",n.isActiveMatchOptions),Y("data-cy",t==null?null:t.T),c(2),f("matTooltip",n.toggleSideMenu?t==null?null:t.T:"")("routerLink",K(7,Ue,t==null?null:t.U)),c(),F(t==null?null:t.I),c(2),V(t==null?null:t.T)}}var P=class e{constructor(i,t,n,u,a,g,R,z){this.toggleSidebar=i;this.signalRClientService=t;this.notificationAlertService=n;this.router=u;this.authService=a;this.intercomService=g;R.initFilteredMenu(),z.initFilteredMenu(),this.leftSidebarMenu=R.filteredMenu,this.topMenu=z.filteredMenu,this.accountInfo=JSON.parse(localStorage.getItem("AccountInfo")),this.toggleSidebar.toggleState$.subscribe(xe=>this.isNavOpen=xe),this.destroy$=new G,this.initNotificationPermission()}isActiveMatchOptions={matrixParams:"subset",queryParams:"subset",paths:"subset",fragment:"exact"};toggleSideMenu=!1;isNavOpen;destroy$;activeMenu;appVersion=ce.version;currentSubStatus;subsStatusEnum=T;isFullContainer=!1;isHideIntercomLauncher;leftSidebarMenu;topMenu;accountInfo;ngOnInit(){this.subscribeToPushNotification(),this.getCurrentSubscriptionStatus(),this.initFullContainer()}initFullContainer(){this.router.events.pipe(E(i=>i instanceof oe),H(null),D(this.destroy$)).subscribe(i=>{this.isFullContainer=!1,(this.router.url.includes("Sell")&&!this.router.url.includes("v2")&&!this.router.url.includes("Offline")||this.router.url.includes("Buy")||this.router.url.includes("menu/Estimate")||this.router.url.includes("Transfer_Order/Form")||this.router.url.includes("Adjustment/Archive/Form")||this.router.url.includes("Job_Order/Archive/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Invoice/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Bill/New_Join_Bill"))&&(this.isFullContainer=!0)})}initNotificationPermission(){this.notificationAlertService.initPermission()}getCurrentSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus()}subscribeToPushNotification(){let i=localStorage.getItem("NotificationOutletID");M.IsNotEmpty(i)&&M.isGuid(i)?this.signalRClientService.SubscribeGroup(i):this.signalRClientService.startConnection(),this.signalRClientService.OnReceivePushNotification.pipe(D(this.destroy$),E(t=>M.IsNotEmpty(t))).subscribe(t=>{if(M.IsNotEmpty(t)){let n=JSON.parse(t),u="//res.cloudinary.com/pos/image/upload/v1657006791/icons/info-new.png";M.IsNotEmpty(n.Icon)&&(u=n.Icon),this.notificationAlertService.showAlert(n.Body,n.Header,n.URL,u)}})}ngAfterViewInit(){this.intercomService.inititalizeIntercom()}toggleMenu(){this.toggleSideMenu=!this.toggleSideMenu}logout(){this.authService.logout()}isNotEmpty(i){return M.IsNotEmpty(i)}onShowDropdown(){this.isHideIntercomLauncher=this.intercomService.isHideLauncher()}chatToggleChange(){this.isHideIntercomLauncher==!1?this.intercomService.hideLauncher():this.intercomService.showLauncher(),this.onShowDropdown()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(t){return new(t||e)(v(ve),v(ue),v(w),v(b),v(h),v(ge),v(k),v(A))};static \u0275cmp=q({type:e,selectors:[["POS-menu-master"]],standalone:!1,decls:52,vars:19,consts:[["rla","routerLinkActive"],[1,"wrapper"],["data-color","blue",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-lg-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fa-solid",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-cy","companyName","data-bs-toggle","dropdown","aria-expanded","false","matTooltipPosition","above",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center",2,"cursor","pointer",3,"click","matTooltip"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["class","dropdown-item h5",3,"routerLink",4,"ngFor","ngForOf"],[1,"dropdown-item","h5",2,"cursor","pointer"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-comment-dots","me-2"],[1,"checkbox_toggle","ms-3",3,"click"],["type","checkbox","id","chatToggle","name","ChatToggle",3,"ngModelChange","ngModel"],["for","chatToggle",1,"position-relative","rounded-pill","pointer"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-sign-out-alt","me-2"],[1,"divider"],[1,"dropdown-header","border-top"],["target","_blank",1,"dropdown-item","h5","changelog",3,"href"],["aria-hidden","true",1,"fa-solid","fa-sparkles","me-2"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],["target","_blank","href","http://support.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-book","me-2"],["target","_blank","href","https://www.dealpos.app/",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-table-cells-large","me-2"],["target","_blank","href","http://blog.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-brands","fa-blogger","me-2"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",3,"routerLinkActiveOptions",4,"ngFor","ngForOf"],["id","full-container",1,"main-panel",3,"ngClass"],[1,"dropdown-item","h5",3,"routerLink"],["aria-hidden","true"],["routerLinkActive","active",3,"routerLinkActiveOptions"],["matTooltipPosition","above",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(t,n){t&1&&(o(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){return n.toggleMenu()}),p(3,"i",4),s(),o(4,"div",5)(5,"div",6)(6,"a",7),C("click",function(){return n.onShowDropdown()}),m(7),ee(8,"limitText"),s(),o(9,"div",8)(10,"div",9),m(11),s(),p(12,"div",10),j(13,Ne,4,4,"a",11),o(14,"a",12)(15,"div",13)(16,"div"),p(17,"i",14),o(18,"span"),m(19,"Chat Support"),s()(),o(20,"div",15),C("click",function(a){return a.stopPropagation()}),o(21,"input",16),C("ngModelChange",function(){return n.chatToggleChange()}),s(),p(22,"label",17),s()()(),o(23,"a",18),C("click",function(){return n.logout()}),p(24,"i",19),o(25,"span"),m(26,"Log Out"),s()(),p(27,"div",20),o(28,"div",21),m(29," Links "),s(),o(30,"a",22),p(31,"i",23),o(32,"span"),m(33,"What's New"),p(34,"i",24),s()(),o(35,"a",25),p(36,"i",26),o(37,"span"),m(38,"Help Center"),s()(),o(39,"a",27),p(40,"i",28),o(41,"span"),m(42,"App Store"),s()(),o(43,"a",29),p(44,"i",30),o(45,"span"),m(46,"Company Blog"),s()()()()(),o(47,"div",31)(48,"ul",32),j(49,Re,6,9,"li",33),s()()(),o(50,"div",34),p(51,"router-outlet"),s()()),t&2&&(W("nav-open",n.isNavOpen),c(),f("ngClass",n.toggleSideMenu?"collapses":""),c(2),f("ngClass",n.toggleSideMenu?"fa-angle-left cursor":"fa-angle-right cursor"),c(3),f("matTooltip",n.accountInfo==null?null:n.accountInfo.BrandName),c(),$(" ",te(8,13,n.accountInfo==null?null:n.accountInfo.BrandName,12)," "),c(4),$("",n.accountInfo==null?null:n.accountInfo.UserName," "),c(2),f("ngForOf",n.topMenu),c(8),f("ngModel",!n.isHideIntercomLauncher),c(9),Z("href","https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=",n.appVersion,"",J),c(19),f("ngForOf",n.leftSidebarMenu),c(),f("ngClass",X(16,Le,n.isFullContainer,n.isNotEmpty(n.currentSubStatus)&&n.currentSubStatus!==n.subsStatusEnum.PAID)))},dependencies:[be,ae,se,le,de,me,fe,ie,ne,Me],styles:['.sidebar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%], body[_ngcontent-%COMP%] > .navbar-collapse[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important}.sidebar-wrapper[_ngcontent-%COMP%]{max-height:calc(100% - 61px)!important;min-height:calc(100% - 61px)!important}@media (max-width: 991px){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (pointer: coarse){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}}.full-container[_ngcontent-%COMP%]{padding-top:0!important}.changelog[_ngcontent-%COMP%]{color:#0006b1!important}.changelog[_ngcontent-%COMP%]:visited{color:#2e2e2e!important}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited:hover span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e9ecef!important;position:absolute;top:-4px;right:-18px}.subscription-bar-visible[_ngcontent-%COMP%]{padding-top:98px}.checkbox_toggle[_ngcontent-%COMP%]{position:relative}.checkbox_toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#868686;display:inline-block;padding-right:38px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:23px;height:14px;background-color:#ccc;top:2.2px;right:0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background-color:#1f77d0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{left:10px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:after{content:"";width:12px;height:12px;border-radius:50%;position:absolute;top:.8px;left:1px;transition:all .1s;background-color:#fff}']})};function Ee(e){let i=l(b),t="/menu";e.forEach(a=>t+=`/${a.path}`);let n=i.getCurrentNavigation().extractedUrl.queryParams;return Object.keys(n).forEach((a,g)=>{g==0?t=`${t}?${a}=${n[a]}`:t=`${t}&${a}=${n[a]}`}),t}var O=(e,i)=>{let t=l(h),n=t.isTokenExpired(),u=l(b);return n?(t.returnUrl=Ee(i),u.navigate(["/"]),!1):e.path=="Dashboard"?De():!0};function De(){let e=l(b),i=l(h),t=!1,n=i.getRedirectUrl();return t=n.includes("Dashboard"),t==!1&&e.navigate([n]),t}var L=class e{paymentStorageService=l(Ce);canActivate(i,t){return this.paymentStorageService.clear(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var U=class e{reportService=l(Pe);canActivate(i,t){return this.reportService.resetFilter(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var je=[{path:"",component:P,children:[{path:"Inventory",loadChildren:()=>import("./chunk-JALOTTYL.js").then(e=>e.InventoryModule),canLoad:[r]},{path:"Reports",loadChildren:()=>import("./chunk-5WBNHRSF.js").then(e=>e.ReportsModule),canLoad:[r],canActivate:[U]},{path:"Sell",loadChildren:()=>import("./chunk-NCR5B5Y4.js").then(e=>e.routes),canLoad:[r]},{path:"Print",loadChildren:()=>import("./chunk-JZEWRW27.js").then(e=>e.PrintModule),canLoad:[r]},{path:"Buy",loadComponent:()=>import("./chunk-MGZYE4DB.js").then(e=>e.BuyV2Component),canMatch:[O]},{path:"Sell/V2",loadComponent:()=>import("./chunk-XETIOXLN.js").then(e=>e.SellV2Component),canMatch:[O]},{path:"Dashboard",loadComponent:()=>import("./chunk-OBZMOT6W.js").then(e=>e.DashboardV2Component),canMatch:[O]},{path:"Products",loadChildren:()=>import("./chunk-N27F227W.js").then(e=>e.ProductModule),canLoad:[r]},{path:"Shift",loadChildren:()=>import("./chunk-W5PF5BAF.js").then(e=>e.ShiftModule),canLoad:[r]},{path:"Debt",loadChildren:()=>import("./chunk-VIYE2OFI.js").then(e=>e.DebtModule),canLoad:[r]},{path:"Logistics",loadChildren:()=>import("./chunk-AHKKBRLR.js").then(e=>e.DeliveryModule),canLoad:[r]},{path:"Users",loadChildren:()=>import("./chunk-LWQAPXWM.js").then(e=>e.UsersModule),canLoad:[r]},{path:"Setup",loadChildren:()=>import("./chunk-K4YULPNU.js").then(e=>e.SetupModule),canLoad:[r]},{path:"Developer",loadChildren:()=>import("./chunk-4F5WEZVF.js").then(e=>e.DeveloperModule),canLoad:[r]},{path:"Contacts",loadChildren:()=>import("./chunk-7MB4HURG.js").then(e=>e.ContactsModule),canLoad:[r]},{path:"Outlets",loadChildren:()=>import("./chunk-EWLYV6PD.js").then(e=>e.OutletsModule),canLoad:[r]},{path:"Orders",loadChildren:()=>import("./chunk-MLQCCNEW.js").then(e=>e.OrdersModule),canLoad:[r]},{path:"Profile",loadChildren:()=>import("./chunk-Y5HNNIJE.js").then(e=>e.ProfileModule),canLoad:[r]},{path:"Estimate",loadComponent:()=>import("./chunk-2BIGSZO5.js").then(e=>e.EstimateV2Component),canMatch:[O]},{path:"Adjustment",loadChildren:()=>import("./chunk-IPTLWEIL.js").then(e=>e.AdjustmentModule),canLoad:[r]},{path:"Payment",loadChildren:()=>import("./chunk-SDGA5WRP.js").then(e=>e.PaymentModule),canLoad:[r],canActivate:[L]},{path:"Promotion",loadChildren:()=>import("./chunk-SMHJ3JIG.js").then(e=>e.PromotionModule),canLoad:[r]},{path:"Manufacture",loadChildren:()=>import("./chunk-A2QB6KDW.js").then(e=>e.ManufactureModule),canLoad:[r]},{path:"Prepaid_Package",loadChildren:()=>import("./chunk-NARPOKGG.js").then(e=>e.PrepaidPackageModule),canLoad:[r]},{path:"Fulfillment",loadChildren:()=>import("./chunk-4TP7S3U3.js").then(e=>e.FulfillmentModule),canLoad:[r]},{path:"Unauthorized",loadChildren:()=>import("./chunk-4PC6PQ7Q.js").then(e=>e.UnauthorizedModule),canLoad:[r]},{path:"Not_Found",loadChildren:()=>import("./chunk-356IV4ZE.js").then(e=>e.NotFoundModule),canLoad:[r]},{path:"",redirectTo:"/menu/Dashboard",pathMatch:"full"},{path:"**",redirectTo:"Not_Found"}]}],N=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e});static \u0275inj=y({imports:[B.forChild(je),B]})};var ye=class e{constructor(){}static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e,bootstrap:[P]});static \u0275inj=y({imports:[Se,N,he,re]})};export{ye as MenuMasterModule};
@@ -1 +1 @@
1
- import{a as ae,b as oe}from"./chunk-TFCJMTMN.js";import"./chunk-7FWWTBUM.js";import"./chunk-4E6VHPVL.js";import{a as re}from"./chunk-6ICMOVBF.js";import"./chunk-5P4BOCQJ.js";import"./chunk-TQFSVWIT.js";import{d as ie,e as ne}from"./chunk-L6LENOKK.js";import"./chunk-UKGYIFR2.js";import"./chunk-JKMM7DWN.js";import"./chunk-I5NNQWTT.js";import"./chunk-3RK6DDJD.js";import"./chunk-736IGW3M.js";import"./chunk-ZMWGK26F.js";import"./chunk-DCBD5TOU.js";import"./chunk-QOFLU7G4.js";import"./chunk-GXRCWDD7.js";import{a as K}from"./chunk-S3THTBYH.js";import"./chunk-2SQ7MIH3.js";import{e as ee}from"./chunk-JVLCOYIS.js";import"./chunk-5Y3O4QKE.js";import"./chunk-VBPW7TJ3.js";import"./chunk-SZQE7PE4.js";import"./chunk-2QMJPLEB.js";import"./chunk-JZDKPV7H.js";import"./chunk-ASYK5WSN.js";import"./chunk-SRTWXKQO.js";import{a as te}from"./chunk-RZNX7JQX.js";import{a as J,h as Z,i as $}from"./chunk-SXKEJJ7X.js";import"./chunk-J7PZTSPK.js";import{b as X}from"./chunk-LI3G6XVH.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{P as Y}from"./chunk-YJVLRBSS.js";import"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import{d as Q}from"./chunk-XOSCYHF7.js";import"./chunk-B4243VJD.js";import"./chunk-7I6FDVVN.js";import"./chunk-7COMDF6M.js";import{a as z}from"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{D as U,h as j,o as G}from"./chunk-LNLGRZBB.js";import"./chunk-74HPFPSG.js";import"./chunk-I5GUKU6V.js";import"./chunk-MP62IGYR.js";import"./chunk-TSWDADFF.js";import{$a as c,Db as A,Dc as O,Eb as E,Gb as V,Hb as W,Ib as n,Jb as a,Kb as S,Lb as D,Mb as v,Ob as T,Qb as y,Rb as s,Td as H,Wd as q,Xc as L,Y as k,ad as N,db as h,ec as u,fa as I,hd as R,jc as g,kb as P,kc as _,lc as f,na as B,ob as M,qb as C,va as p,vb as l,wa as m,xc as b,yc as x}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function pe(o,d){if(o&1){let t=T();n(0,"button",7),y("click",function(){p(t);let e=s();return m(e.onPrint())}),S(1,"i",8),n(2,"span"),u(3,"Print"),a()()}}function me(o,d){if(o&1){let t=T();n(0,"div",9)(1,"h6"),u(2,"Outlet"),a(),n(3,"outlet-selector",10),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EntityID,e)||(i.pageData.Filter.EntityID=e),m(e)}),a(),n(4,"h6"),u(5,"Sales Order Tag"),a(),n(6,"ng-select",11),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.SalesOrderTagID,e)||(i.pageData.Filter.SalesOrderTagID=e),m(e)}),a(),n(7,"h6"),u(8,"From"),a(),n(9,"div",12)(10,"div",13)(11,"datepicker",14),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.From,e)||(i.pageData.Filter.From=e),m(e)}),a()(),n(12,"div",13)(13,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.StartTime,e)||(i.pageData.Filter.StartTime=e),m(e)}),a()()(),n(14,"h6"),u(15,"To"),a(),n(16,"div",12)(17,"div",13)(18,"datepicker",16),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.To,e)||(i.pageData.Filter.To=e),m(e)}),a()(),n(19,"div",13)(20,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EndTime,e)||(i.pageData.Filter.EndTime=e),m(e)}),a()()()()}if(o&2){let t=s();c(3),l("accessType",2),g("ngModel",t.pageData.Filter.EntityID),c(3),l("items",t.pageData==null||t.pageData.Options==null?null:t.pageData.Options.SalesOrderTags),g("ngModel",t.pageData.Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),g("date",t.pageData.Filter.From),l("hidelClearBtn",!0),c(2),g("time",t.pageData.Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),g("date",t.pageData.Filter.To),c(2),g("time",t.pageData.Filter.EndTime),l("fullWidth",!0)}}function ce(o,d){o&1&&(D(0),n(1,"div",20),u(2,"\xA0"),a(),v())}function se(o,d){if(o&1&&(S(0,"pos-receipt-a4",17),n(1,"div",18),S(2,"div",19),a(),C(3,ce,3,0,"ng-container",6)),o&2){let t=d.$implicit,r=d.$index,e=s().ngIf,i=s();l("data",t)("printTemplate",i.printTemplates==null?null:i.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),l("ngIf",r!==(e.Data==null?null:e.Data.length)-1)}}function de(o,d){if(o&1&&(D(0),V(1,se,4,7,null,null,E),v()),o&2){let t=d.ngIf;c(),W(t.Data)}}var le=class o extends K{constructor(t,r,e){super(t,r,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=r}dialogFilter=B(J);receipts$;printTemplates;preInitList(){this.pageData.Filter.From=new Date,this.pageData.Filter.To=new Date,this.pageData.Filter.StartTime="00:00",this.pageData.Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(Y.GetBulkPrintA4,this.pageData.Filter).pipe(I(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",z.Info):this.generatePrintTemplate(t.PrintTemplates)}),k(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(r=>[r.ID,r]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}static \u0275fac=function(r){return new(r||o)(h(X),h(q),h(H))};static \u0275cmp=P({type:o,selectors:[["bulk-invoice-A4"]],features:[M],decls:13,vars:10,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","pageData","hideSearchBox","text","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(r,e){if(r&1){let i=T();n(0,"mainpanel-cmp",1),f("textChange",function(w){return p(i),_(e.pageData.Filter.Number,w)||(e.pageData.Filter.Number=w),m(w)}),y("onSubmit",function(){return p(i),m(e.onFilter())}),n(1,"actions"),C(2,pe,4,0,"button",2),b(3,"async"),n(4,"button",3),y("click",function(){return p(i),m(e.onNewPrint())}),u(5,"New"),a()(),n(6,"div",4),C(7,me,21,14,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5),C(11,de,3,0,"ng-container",6),b(12,"async"),a()()()}if(r&2){let i;l("pageData",e.menuData)("hideSearchBox",!0),g("text",e.pageData.Filter.Number),l("hideSearchDropdown",!0),c(2),A(((i=x(3,6,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),c(9),l("ngIf",x(12,8,e.printTemplates&&e.receipts$))}},dependencies:[R,L,N,oe,ae,$,Z,te,Q,ne,ie,ee,U,j,G,re],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})};export{le as BulkInvoiceA4Component};
1
+ import{a as ae,b as oe}from"./chunk-TFCJMTMN.js";import"./chunk-7FWWTBUM.js";import"./chunk-4E6VHPVL.js";import{a as re}from"./chunk-6ICMOVBF.js";import"./chunk-5P4BOCQJ.js";import"./chunk-TQFSVWIT.js";import{d as ie,e as ne}from"./chunk-L6LENOKK.js";import"./chunk-UKGYIFR2.js";import"./chunk-JKMM7DWN.js";import"./chunk-I5NNQWTT.js";import"./chunk-3RK6DDJD.js";import"./chunk-736IGW3M.js";import"./chunk-ZMWGK26F.js";import"./chunk-DCBD5TOU.js";import"./chunk-QOFLU7G4.js";import"./chunk-GXRCWDD7.js";import{a as K}from"./chunk-SGTPMFH6.js";import"./chunk-B7DKFLLG.js";import{e as ee}from"./chunk-JVLCOYIS.js";import"./chunk-5Y3O4QKE.js";import"./chunk-VBPW7TJ3.js";import"./chunk-SZQE7PE4.js";import"./chunk-2QMJPLEB.js";import"./chunk-JZDKPV7H.js";import"./chunk-ASYK5WSN.js";import"./chunk-SRTWXKQO.js";import{a as te}from"./chunk-RZNX7JQX.js";import{a as J,h as Z,i as $}from"./chunk-6IFNMT72.js";import"./chunk-4KJRE3GP.js";import{b as X}from"./chunk-5233FXFY.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{P as Y}from"./chunk-YJVLRBSS.js";import"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import{d as Q}from"./chunk-XOSCYHF7.js";import"./chunk-B4243VJD.js";import"./chunk-7I6FDVVN.js";import"./chunk-7COMDF6M.js";import{a as z}from"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{D as U,h as j,o as G}from"./chunk-LNLGRZBB.js";import"./chunk-DMSBV63C.js";import"./chunk-MAFIFJSJ.js";import"./chunk-MP62IGYR.js";import"./chunk-J6RZLLDH.js";import{$a as c,Db as A,Dc as O,Eb as E,Gb as V,Hb as W,Ib as n,Jb as a,Kb as S,Lb as D,Mb as v,Ob as T,Qb as y,Rb as s,Td as H,Wd as q,Xc as L,Y as k,ad as N,db as h,ec as u,fa as I,hd as R,jc as g,kb as P,kc as _,lc as f,na as B,ob as M,qb as C,va as p,vb as l,wa as m,xc as b,yc as x}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function pe(o,d){if(o&1){let t=T();n(0,"button",7),y("click",function(){p(t);let e=s();return m(e.onPrint())}),S(1,"i",8),n(2,"span"),u(3,"Print"),a()()}}function me(o,d){if(o&1){let t=T();n(0,"div",9)(1,"h6"),u(2,"Outlet"),a(),n(3,"outlet-selector",10),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EntityID,e)||(i.pageData.Filter.EntityID=e),m(e)}),a(),n(4,"h6"),u(5,"Sales Order Tag"),a(),n(6,"ng-select",11),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.SalesOrderTagID,e)||(i.pageData.Filter.SalesOrderTagID=e),m(e)}),a(),n(7,"h6"),u(8,"From"),a(),n(9,"div",12)(10,"div",13)(11,"datepicker",14),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.From,e)||(i.pageData.Filter.From=e),m(e)}),a()(),n(12,"div",13)(13,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.StartTime,e)||(i.pageData.Filter.StartTime=e),m(e)}),a()()(),n(14,"h6"),u(15,"To"),a(),n(16,"div",12)(17,"div",13)(18,"datepicker",16),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.To,e)||(i.pageData.Filter.To=e),m(e)}),a()(),n(19,"div",13)(20,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EndTime,e)||(i.pageData.Filter.EndTime=e),m(e)}),a()()()()}if(o&2){let t=s();c(3),l("accessType",2),g("ngModel",t.pageData.Filter.EntityID),c(3),l("items",t.pageData==null||t.pageData.Options==null?null:t.pageData.Options.SalesOrderTags),g("ngModel",t.pageData.Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),g("date",t.pageData.Filter.From),l("hidelClearBtn",!0),c(2),g("time",t.pageData.Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),g("date",t.pageData.Filter.To),c(2),g("time",t.pageData.Filter.EndTime),l("fullWidth",!0)}}function ce(o,d){o&1&&(D(0),n(1,"div",20),u(2,"\xA0"),a(),v())}function se(o,d){if(o&1&&(S(0,"pos-receipt-a4",17),n(1,"div",18),S(2,"div",19),a(),C(3,ce,3,0,"ng-container",6)),o&2){let t=d.$implicit,r=d.$index,e=s().ngIf,i=s();l("data",t)("printTemplate",i.printTemplates==null?null:i.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),l("ngIf",r!==(e.Data==null?null:e.Data.length)-1)}}function de(o,d){if(o&1&&(D(0),V(1,se,4,7,null,null,E),v()),o&2){let t=d.ngIf;c(),W(t.Data)}}var le=class o extends K{constructor(t,r,e){super(t,r,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=r}dialogFilter=B(J);receipts$;printTemplates;preInitList(){this.pageData.Filter.From=new Date,this.pageData.Filter.To=new Date,this.pageData.Filter.StartTime="00:00",this.pageData.Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(Y.GetBulkPrintA4,this.pageData.Filter).pipe(I(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",z.Info):this.generatePrintTemplate(t.PrintTemplates)}),k(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(r=>[r.ID,r]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}static \u0275fac=function(r){return new(r||o)(h(X),h(q),h(H))};static \u0275cmp=P({type:o,selectors:[["bulk-invoice-A4"]],features:[M],decls:13,vars:10,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","pageData","hideSearchBox","text","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(r,e){if(r&1){let i=T();n(0,"mainpanel-cmp",1),f("textChange",function(w){return p(i),_(e.pageData.Filter.Number,w)||(e.pageData.Filter.Number=w),m(w)}),y("onSubmit",function(){return p(i),m(e.onFilter())}),n(1,"actions"),C(2,pe,4,0,"button",2),b(3,"async"),n(4,"button",3),y("click",function(){return p(i),m(e.onNewPrint())}),u(5,"New"),a()(),n(6,"div",4),C(7,me,21,14,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5),C(11,de,3,0,"ng-container",6),b(12,"async"),a()()()}if(r&2){let i;l("pageData",e.menuData)("hideSearchBox",!0),g("text",e.pageData.Filter.Number),l("hideSearchDropdown",!0),c(2),A(((i=x(3,6,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),c(9),l("ngIf",x(12,8,e.printTemplates&&e.receipts$))}},dependencies:[R,L,N,oe,ae,$,Z,te,Q,ne,ie,ee,U,j,G,re],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})};export{le as BulkInvoiceA4Component};
@@ -1,4 +1,4 @@
1
- import{a as yt,c as xt}from"./chunk-7I6FDVVN.js";import{a as wt}from"./chunk-7COMDF6M.js";import{a as P}from"./chunk-2FWFPV5I.js";import{ja as _t,ka as S,sa as ht}from"./chunk-NEEN2JO2.js";import{D as mt,E as gt,a as st,c as at,h as pt,i as lt,k as ut,o as ct,p as dt}from"./chunk-LNLGRZBB.js";import{a as ot}from"./chunk-TSWDADFF.js";import{$a as l,$b as D,$c as et,Ab as V,Fa as T,Ib as o,Jb as a,Kb as E,Kc as X,Lb as _,Mb as h,Nb as U,Ob as w,Oc as $,Od as it,Qb as f,Rb as r,Td as rt,Uc as I,Wc as tt,Wd as ft,Xc as M,Yb as A,_b as N,bc as q,cc as K,db as j,ec as m,fc as Y,gb as W,gc as G,hd as nt,ia as R,ja as H,jc as C,ka as L,kb as O,kc as b,lb as z,lc as v,na as x,nc as Z,ob as Q,qb as g,qc as B,rc as J,va as c,vb as u,wa as d,za as F}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";var Ot=["input"],Et=(i,s,t)=>({$implicit:i,events:s,index:t});function It(i,s){if(i&1){let t=w();_(0),o(1,"input",2),f("input",function(n){c(t);let p=r().$implicit,y=r();return d(y.onInput(n,p-1))})("focus",function(n){c(t);let p=r(2);return d(p.onInputFocus(n))})("blur",function(n){c(t);let p=r(2);return d(p.onInputBlur(n))})("paste",function(n){c(t);let p=r(2);return d(p.onPaste(n))})("keydown",function(n){c(t);let p=r(2);return d(p.onKeyDown(n))}),a(),h()}if(i&2){let t=r().$implicit,e=r();l(),u("value",e.getModelValue(t))("maxLength",t===1?e.length:1)("type",e.inputType)("pSize",e.size)("variant",e.variant)("readonly",e.readonly)("disabled",e.disabled)("tabindex",e.tabindex)("pAutoFocus",e.getAutofocus(t))("ngClass",e.styleClass)}}function Mt(i,s){i&1&&U(0)}function St(i,s){if(i&1&&(_(0),g(1,Mt,1,0,"ng-container",3),h()),i&2){let t=r().$implicit,e=r();l(),u("ngTemplateOutlet",e.inputTemplate||e._inputTemplate)("ngTemplateOutletContext",J(2,Et,e.getToken(t-1),e.getTemplateEvents(t-1),t))}}function kt(i,s){if(i&1&&(_(0),g(1,It,2,10,"ng-container",1)(2,St,2,6,"ng-container",1),h()),i&2){let t=r();l(),u("ngIf",!t.inputTemplate&&!t._inputTemplate),l(),u("ngIf",t.inputTemplate||t._inputTemplate)}}var Ft=({dt:i})=>`
1
+ import{a as yt,c as xt}from"./chunk-7I6FDVVN.js";import{a as wt}from"./chunk-7COMDF6M.js";import{a as P}from"./chunk-2FWFPV5I.js";import{ja as _t,ka as S,sa as ht}from"./chunk-NEEN2JO2.js";import{D as mt,E as gt,a as st,c as at,h as pt,i as lt,k as ut,o as ct,p as dt}from"./chunk-LNLGRZBB.js";import{a as ot}from"./chunk-J6RZLLDH.js";import{$a as l,$b as D,$c as et,Ab as V,Fa as T,Ib as o,Jb as a,Kb as E,Kc as X,Lb as _,Mb as h,Nb as U,Ob as w,Oc as $,Od as it,Qb as f,Rb as r,Td as rt,Uc as I,Wc as tt,Wd as ft,Xc as M,Yb as A,_b as N,bc as q,cc as K,db as j,ec as m,fc as Y,gb as W,gc as G,hd as nt,ia as R,ja as H,jc as C,ka as L,kb as O,kc as b,lb as z,lc as v,na as x,nc as Z,ob as Q,qb as g,qc as B,rc as J,va as c,vb as u,wa as d,za as F}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";var Ot=["input"],Et=(i,s,t)=>({$implicit:i,events:s,index:t});function It(i,s){if(i&1){let t=w();_(0),o(1,"input",2),f("input",function(n){c(t);let p=r().$implicit,y=r();return d(y.onInput(n,p-1))})("focus",function(n){c(t);let p=r(2);return d(p.onInputFocus(n))})("blur",function(n){c(t);let p=r(2);return d(p.onInputBlur(n))})("paste",function(n){c(t);let p=r(2);return d(p.onPaste(n))})("keydown",function(n){c(t);let p=r(2);return d(p.onKeyDown(n))}),a(),h()}if(i&2){let t=r().$implicit,e=r();l(),u("value",e.getModelValue(t))("maxLength",t===1?e.length:1)("type",e.inputType)("pSize",e.size)("variant",e.variant)("readonly",e.readonly)("disabled",e.disabled)("tabindex",e.tabindex)("pAutoFocus",e.getAutofocus(t))("ngClass",e.styleClass)}}function Mt(i,s){i&1&&U(0)}function St(i,s){if(i&1&&(_(0),g(1,Mt,1,0,"ng-container",3),h()),i&2){let t=r().$implicit,e=r();l(),u("ngTemplateOutlet",e.inputTemplate||e._inputTemplate)("ngTemplateOutletContext",J(2,Et,e.getToken(t-1),e.getTemplateEvents(t-1),t))}}function kt(i,s){if(i&1&&(_(0),g(1,It,2,10,"ng-container",1)(2,St,2,6,"ng-container",1),h()),i&2){let t=r();l(),u("ngIf",!t.inputTemplate&&!t._inputTemplate),l(),u("ngIf",t.inputTemplate||t._inputTemplate)}}var Ft=({dt:i})=>`
2
2
  .p-inputotp {
3
3
  display: flex;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{f as te}from"./chunk-POKWPMMW.js";import"./chunk-35R6HA62.js";import"./chunk-LNXXY6IT.js";import"./chunk-RCUV6EEF.js";import{a as oe,b as ne}from"./chunk-BIFPTMSG.js";import{b as Q}from"./chunk-65O6NGE3.js";import{a as H,b as G,c as A}from"./chunk-KERM64H3.js";import{a as q}from"./chunk-S3THTBYH.js";import"./chunk-2SQ7MIH3.js";import{d as $,e as ee}from"./chunk-JVLCOYIS.js";import"./chunk-KLEBNCTU.js";import"./chunk-QYL74IT3.js";import"./chunk-5Y3O4QKE.js";import"./chunk-VBPW7TJ3.js";import"./chunk-SZQE7PE4.js";import"./chunk-2QMJPLEB.js";import"./chunk-JZDKPV7H.js";import{a as z}from"./chunk-HD7L5UBP.js";import"./chunk-ASYK5WSN.js";import"./chunk-SRTWXKQO.js";import"./chunk-5P2LSOX6.js";import{a as ie}from"./chunk-RZNX7JQX.js";import{h as Y,i as Z}from"./chunk-SXKEJJ7X.js";import"./chunk-J7PZTSPK.js";import{b as K}from"./chunk-LI3G6XVH.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{w as J}from"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{O as X,g as U}from"./chunk-YJVLRBSS.js";import"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import"./chunk-XOSCYHF7.js";import"./chunk-B4243VJD.js";import"./chunk-7I6FDVVN.js";import"./chunk-7COMDF6M.js";import"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{D as W,h as B,o as R}from"./chunk-LNLGRZBB.js";import"./chunk-74HPFPSG.js";import"./chunk-I5GUKU6V.js";import{d as k}from"./chunk-MP62IGYR.js";import"./chunk-TSWDADFF.js";import{$a as p,Dc as V,Eb as b,Gb as M,Hb as O,Ib as i,Jb as o,Kb as v,Ob as _,Qb as S,Rb as m,Wd as j,Xc as F,db as u,ec as l,fc as h,gc as w,hd as N,jc as x,kb as E,kc as C,lc as y,ob as I,qb as f,va as c,vb as d,wa as s,xc as D,yc as P,zc as T}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function re(r,g){if(r&1){let e=_();i(0,"button",5),S("click",function(){c(e);let t=m();return s(t.openExportModal())}),v(1,"i",6),l(2," Export "),o()}}function le(r,g){if(r&1){let e=_();i(0,"h6"),l(1,"Outlet"),o(),i(2,"outlet-selector",7),y("ngModelChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Outlet,t)||(a.pageData.Filter.Outlet=t),s(t)}),o(),i(3,"h6"),l(4,"Category"),o(),i(5,"POS-product-category-select",8),y("selectedCategoryIDChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Category,t)||(a.pageData.Filter.Category=t),s(t)}),o(),i(6,"h6"),l(7,"Discontinued"),o(),i(8,"radio-options",9),y("modelChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Discontinued,t)||(a.pageData.Filter.Discontinued=t),s(t)}),o()}if(r&2){let e=m();p(2),d("accessType",2),x("ngModel",e.pageData.Filter.Outlet),p(3),x("selectedCategoryID",e.pageData.Filter.Category),d("showClear",!0),p(3),d("options",e.pageData==null||e.pageData.Options==null?null:e.pageData.Options.Discontinued),x("model",e.pageData.Filter.Discontinued)}}function pe(r,g){if(r&1&&(i(0,"tr")(1,"td"),l(2),o(),i(3,"td"),l(4),o(),i(5,"td",20),l(6),D(7,"quantityFraction"),o()()),r&2){let e=g.$implicit;p(2),h(e.EntityName),p(2),h(e.Name),p(2),w(" ",P(7,3,e.Inventory)," ")}}function me(r,g){if(r&1){let e=_();i(0,"div",10)(1,"div",11)(2,"table",12),S("matSortChange",function(t){c(e);let a=m();return s(a.onSortData(t))}),i(3,"thead",13)(4,"tr",14)(5,"th",15),l(6,"Outlet"),o(),i(7,"th",16),l(8,"Storage Location"),o(),i(9,"th",17),l(10," On Hand "),o()()(),i(11,"tbody"),M(12,pe,8,5,"tr",null,b),o(),i(14,"tfoot")(15,"tr",18),v(16,"td",19),i(17,"td",19),l(18,"Total :"),o(),i(19,"td",20),l(20),D(21,"sum"),D(22,"quantityFraction"),o()()()(),i(23,"POS-complex-pagination",21),S("jumpToPage",function(){c(e);let t=m();return s(t.getListData())})("previousPage",function(){c(e);let t=m();return s(t.getListData())})("nextPage",function(){c(e);let t=m();return s(t.getListData())}),o()()()}if(r&2){let e=m();p(12),O(e.data.Data),p(8),w(" ",P(22,6,T(21,3,e.data.Data,"Inventory"))," "),p(3),d("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ae=class r extends q{constructor(e,n,t,a){super(e,n,"Inventory/GetProductStorageLocation","InventoryLoader/InventoryReport");this.httpService=n;this.dialog=t;this.roleService=a}datasource;postInit(e){this.datasource=JSON.parse(JSON.stringify(e.Data))}openExportModal(){this.dialog.open(Q,{data:{title:"Storage Location",exportTypes:[{ID:"Inventory/GetProductStorageLocation",Value:"Default",FileName:"Storage Location"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"inventory/GetCountProductStorageLocation",pagination:!0}})}onSortData(e){let n=this.data.Data?.slice();if(!e.active||e.direction===""){this.data.Data=this.datasource;return}let t=e.direction==="asc";this.data.Data=n.sort((a,L)=>this.compare(a[e.active],L[e.active],t))}static \u0275fac=function(n){return new(n||r)(u(K),u(j),u(J),u(k))};static \u0275cmp=E({type:r,selectors:[["app-storage-location"]],features:[I],decls:9,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"d-flex"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-3",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["placeholder","Choose an outlet","appendTo","body",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","Discontinued",3,"modelChange","options","model"],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","EntityName",2,"width","450px"],["mat-sort-header","Brand"],["mat-sort-header","Inventory","arrowPosition","before",1,"text-end",2,"padding-right","100px","width","190px"],[1,"table-footer","fw-bold"],[1,"empty-column"],[1,"text-end",2,"padding-right","100px"],["api","inventory/GetCountProductStorageLocation",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(n,t){if(n&1){let a=_();i(0,"mainpanel-cmp",1),S("onSubmit",function(){return c(a),s(t.searchFromPageOne())}),i(1,"actions")(2,"div",2),f(3,re,3,0,"button",3),o()(),i(4,"filters"),f(5,le,9,6,"ng-template",null,0,V),o(),i(7,"content"),f(8,me,24,8,"div",4),o()()}n&2&&(d("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),p(3),d("ngIf",t.roleService.global.Export),p(5),d("ngIf",t.data))},dependencies:[N,F,Z,Y,z,X,U,ee,$,te,ie,W,B,R,ne,oe,A,H,G],encapsulation:2})};export{ae as StorageLocationComponent};
1
+ import{f as te}from"./chunk-6K77FOTH.js";import"./chunk-35R6HA62.js";import"./chunk-LNXXY6IT.js";import"./chunk-RCUV6EEF.js";import{a as oe,b as ne}from"./chunk-BIFPTMSG.js";import{b as Q}from"./chunk-65O6NGE3.js";import{a as H,b as G,c as A}from"./chunk-KERM64H3.js";import{a as q}from"./chunk-SGTPMFH6.js";import"./chunk-B7DKFLLG.js";import{d as $,e as ee}from"./chunk-JVLCOYIS.js";import"./chunk-KLEBNCTU.js";import"./chunk-QYL74IT3.js";import"./chunk-5Y3O4QKE.js";import"./chunk-VBPW7TJ3.js";import"./chunk-SZQE7PE4.js";import"./chunk-2QMJPLEB.js";import"./chunk-JZDKPV7H.js";import{a as z}from"./chunk-HD7L5UBP.js";import"./chunk-ASYK5WSN.js";import"./chunk-SRTWXKQO.js";import"./chunk-5P2LSOX6.js";import{a as ie}from"./chunk-RZNX7JQX.js";import{h as Y,i as Z}from"./chunk-6IFNMT72.js";import"./chunk-4KJRE3GP.js";import{b as K}from"./chunk-5233FXFY.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{w as J}from"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{O as X,g as U}from"./chunk-YJVLRBSS.js";import"./chunk-UM35BDBC.js";import"./chunk-GIKR6Y2K.js";import"./chunk-XOSCYHF7.js";import"./chunk-B4243VJD.js";import"./chunk-7I6FDVVN.js";import"./chunk-7COMDF6M.js";import"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{D as W,h as B,o as R}from"./chunk-LNLGRZBB.js";import"./chunk-DMSBV63C.js";import"./chunk-MAFIFJSJ.js";import{d as k}from"./chunk-MP62IGYR.js";import"./chunk-J6RZLLDH.js";import{$a as p,Dc as V,Eb as b,Gb as M,Hb as O,Ib as i,Jb as o,Kb as v,Ob as _,Qb as S,Rb as m,Wd as j,Xc as F,db as u,ec as l,fc as h,gc as w,hd as N,jc as x,kb as E,kc as C,lc as y,ob as I,qb as f,va as c,vb as d,wa as s,xc as D,yc as P,zc as T}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function re(r,g){if(r&1){let e=_();i(0,"button",5),S("click",function(){c(e);let t=m();return s(t.openExportModal())}),v(1,"i",6),l(2," Export "),o()}}function le(r,g){if(r&1){let e=_();i(0,"h6"),l(1,"Outlet"),o(),i(2,"outlet-selector",7),y("ngModelChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Outlet,t)||(a.pageData.Filter.Outlet=t),s(t)}),o(),i(3,"h6"),l(4,"Category"),o(),i(5,"POS-product-category-select",8),y("selectedCategoryIDChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Category,t)||(a.pageData.Filter.Category=t),s(t)}),o(),i(6,"h6"),l(7,"Discontinued"),o(),i(8,"radio-options",9),y("modelChange",function(t){c(e);let a=m();return C(a.pageData.Filter.Discontinued,t)||(a.pageData.Filter.Discontinued=t),s(t)}),o()}if(r&2){let e=m();p(2),d("accessType",2),x("ngModel",e.pageData.Filter.Outlet),p(3),x("selectedCategoryID",e.pageData.Filter.Category),d("showClear",!0),p(3),d("options",e.pageData==null||e.pageData.Options==null?null:e.pageData.Options.Discontinued),x("model",e.pageData.Filter.Discontinued)}}function pe(r,g){if(r&1&&(i(0,"tr")(1,"td"),l(2),o(),i(3,"td"),l(4),o(),i(5,"td",20),l(6),D(7,"quantityFraction"),o()()),r&2){let e=g.$implicit;p(2),h(e.EntityName),p(2),h(e.Name),p(2),w(" ",P(7,3,e.Inventory)," ")}}function me(r,g){if(r&1){let e=_();i(0,"div",10)(1,"div",11)(2,"table",12),S("matSortChange",function(t){c(e);let a=m();return s(a.onSortData(t))}),i(3,"thead",13)(4,"tr",14)(5,"th",15),l(6,"Outlet"),o(),i(7,"th",16),l(8,"Storage Location"),o(),i(9,"th",17),l(10," On Hand "),o()()(),i(11,"tbody"),M(12,pe,8,5,"tr",null,b),o(),i(14,"tfoot")(15,"tr",18),v(16,"td",19),i(17,"td",19),l(18,"Total :"),o(),i(19,"td",20),l(20),D(21,"sum"),D(22,"quantityFraction"),o()()()(),i(23,"POS-complex-pagination",21),S("jumpToPage",function(){c(e);let t=m();return s(t.getListData())})("previousPage",function(){c(e);let t=m();return s(t.getListData())})("nextPage",function(){c(e);let t=m();return s(t.getListData())}),o()()()}if(r&2){let e=m();p(12),O(e.data.Data),p(8),w(" ",P(22,6,T(21,3,e.data.Data,"Inventory"))," "),p(3),d("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ae=class r extends q{constructor(e,n,t,a){super(e,n,"Inventory/GetProductStorageLocation","InventoryLoader/InventoryReport");this.httpService=n;this.dialog=t;this.roleService=a}datasource;postInit(e){this.datasource=JSON.parse(JSON.stringify(e.Data))}openExportModal(){this.dialog.open(Q,{data:{title:"Storage Location",exportTypes:[{ID:"Inventory/GetProductStorageLocation",Value:"Default",FileName:"Storage Location"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"inventory/GetCountProductStorageLocation",pagination:!0}})}onSortData(e){let n=this.data.Data?.slice();if(!e.active||e.direction===""){this.data.Data=this.datasource;return}let t=e.direction==="asc";this.data.Data=n.sort((a,L)=>this.compare(a[e.active],L[e.active],t))}static \u0275fac=function(n){return new(n||r)(u(K),u(j),u(J),u(k))};static \u0275cmp=E({type:r,selectors:[["app-storage-location"]],features:[I],decls:9,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"d-flex"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-3",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["placeholder","Choose an outlet","appendTo","body",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","Discontinued",3,"modelChange","options","model"],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","EntityName",2,"width","450px"],["mat-sort-header","Brand"],["mat-sort-header","Inventory","arrowPosition","before",1,"text-end",2,"padding-right","100px","width","190px"],[1,"table-footer","fw-bold"],[1,"empty-column"],[1,"text-end",2,"padding-right","100px"],["api","inventory/GetCountProductStorageLocation",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(n,t){if(n&1){let a=_();i(0,"mainpanel-cmp",1),S("onSubmit",function(){return c(a),s(t.searchFromPageOne())}),i(1,"actions")(2,"div",2),f(3,re,3,0,"button",3),o()(),i(4,"filters"),f(5,le,9,6,"ng-template",null,0,V),o(),i(7,"content"),f(8,me,24,8,"div",4),o()()}n&2&&(d("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),p(3),d("ngIf",t.roleService.global.Export),p(5),d("ngIf",t.data))},dependencies:[N,F,Z,Y,z,X,U,ee,$,te,ie,W,B,R,ne,oe,A,H,G],encapsulation:2})};export{ae as StorageLocationComponent};
@@ -1 +1 @@
1
- import{a as ve}from"./chunk-CXYH2IZT.js";import{a as Ce}from"./chunk-OHW6ADB3.js";import{a as fe}from"./chunk-FCHZ7VUL.js";import"./chunk-BYXBJQAS.js";import{h as se,i as ce}from"./chunk-SXKEJJ7X.js";import"./chunk-J7PZTSPK.js";import{b as ue}from"./chunk-LI3G6XVH.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{C as de,D as pe,E as me,u as re,v as ae,w as le}from"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{P as F}from"./chunk-YJVLRBSS.js";import"./chunk-B4243VJD.js";import"./chunk-7COMDF6M.js";import"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{C as ee,D as oe,E as te,c as z,e as _,h as J,i as Y,p as X,t as Q,u as Z}from"./chunk-LNLGRZBB.js";import"./chunk-74HPFPSG.js";import"./chunk-I5GUKU6V.js";import{a as w,d as ie}from"./chunk-MP62IGYR.js";import"./chunk-TSWDADFF.js";import{$a as l,$c as L,Db as f,Dc as q,E as N,Eb as A,Gb as O,Hb as U,Ib as n,Jb as i,Kb as s,Ma as D,Md as B,Nb as H,Nc as K,Ob as T,Qb as v,Rb as h,Td as W,Uc as R,Wd as ne,db as c,dc as $,ec as a,fc as G,gc as I,hd as M,kb as E,na as g,ob as V,pc as b,qb as u,qc as j,t as k,va as P,vb as m,wa as y}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";var x=r=>({"is-invalid":r});function Pe(r,d){r&1&&(n(0,"div",16),a(1," Provider Name is required "),i())}function ye(r,d){r&1&&(n(0,"div",20),a(1," Validate Coupon URL is required "),i())}function Ee(r,d){r&1&&(n(0,"div",20),a(1," Redeem Coupon URL is required "),i())}function Ge(r,d){r&1&&(n(0,"div",20),a(1,"Key is required"),i())}var S=class r{constructor(d){this.data=d;this.config=new de,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=g(re);config;fb=g(ee);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[_.required]],validateCoupon:[this.data?.validateCoupon||"",[_.required]],redeemCoupon:[this.data?.redeemCoupon||"",[_.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[_.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||r)(c(ae))};static \u0275cmp=E({type:r,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(n(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),n(11,"label",10),a(12,"Coupon Provider"),i()()(),n(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),i(),n(17,"label",15),a(18,"Enabled"),i()()()(),u(19,Pe,2,0,"div",16),i(),n(20,"div",17),s(21,"input",18),n(22,"label",19),a(23,"Validate Coupon URL"),i(),u(24,ye,2,0,"div",20),i(),n(25,"div",17),s(26,"input",21),n(27,"label",22),a(28,"Redeem Coupon URL"),i(),u(29,Ee,2,0,"div",20),i(),n(30,"div",23),s(31,"textarea",24),n(32,"label",25),a(33,"Request Header (Key: value)"),i(),u(34,Ge,2,0,"div",20),i()()()()()()()),e&2&&(m("config",o.config),l(5),m("formGroup",o.formGroup),l(5),m("ngClass",b(10,x,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),f(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),m("ngClass",b(12,x,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),f(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),m("ngClass",b(14,x,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),f(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),m("ngClass",b(16,x,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),f(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,te,X,z,J,Y,Q,Z,me,pe,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(r,d)=>({"bg-success-subtle text-success-emphasis":r,"bg-danger-subtle text-danger-emphasis":d});function Me(r,d){if(r&1){let e=T();n(0,"tr")(1,"td",10)(2,"i",11),v("click",function(){let t=P(e).$index,p=h(2);return y(p.onDeleteProvider(t))}),i()(),n(3,"td")(4,"a",12),v("click",function(){let t=P(e),p=t.$implicit,C=t.$index,he=h(2);return y(he.onUpdateProvider(p,C))}),a(5),i()(),n(6,"td"),a(7),i(),n(8,"td"),a(9),i(),n(10,"td"),a(11),i(),n(12,"td")(13,"span",13),a(14),i()()()}if(r&2){let e=d.$implicit;l(5),I(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),m("ngClass",j(6,Re,e.Enabled,!e.Enabled)),l(),I(" ",e.Enabled?"Enabled":"Disabled"," ")}}function xe(r,d){if(r&1&&O(0,Me,15,9,"tr",null,A),r&2){let e=h();U(e.listProviders())}}function Ne(r,d){r&1&&H(0)}function Te(r,d){if(r&1&&u(0,Ne,1,0,"ng-container",14),r&2){h();let e=$(26);m("ngTemplateOutlet",e)}}function Ie(r,d){r&1&&(n(0,"tr",15)(1,"td",16),s(2,"empty-state-table"),i()())}var ge=class r extends Ce{constructor(e,o,t,p,C){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=p;this.dialog=C}toastr=g(W);couponProviders=D([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let p={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(C=>(C[o]=p,[...C])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||r)(c(ue),c(ne),c(B),c(ie),c(le))};static \u0275cmp=E({type:r,selectors:[["app-coupon-configuration"]],features:[V],decls:27,vars:4,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1){let p=T();n(0,"mainpanel-cmp",1)(1,"actions")(2,"button",2),v("click",function(){return P(p),y(t.addNewCouponProvider())}),a(3," Add "),i()(),n(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"table",6)(9,"thead",7)(10,"tr"),s(11,"th",8),n(12,"th",9),a(13,"Name"),i(),n(14,"th"),a(15,"Validate Coupon"),i(),n(16,"th"),a(17,"Redeem Coupon"),i(),n(18,"th"),a(19,"Value"),i(),n(20,"th"),a(21,"Status"),i()()(),n(22,"tbody"),u(23,xe,2,0)(24,Te,1,1,"ng-container"),i()()()()(),u(25,Ie,3,0,"ng-template",null,0,q),i()()}if(o&2){let p;m("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(23),f(((p=t.listProviders())==null?null:p.length)>0?23:24)}},dependencies:[M,R,L,ce,se,oe,fe],encapsulation:2})};export{ge as CouponConfigurationComponent};
1
+ import{a as ve}from"./chunk-CXYH2IZT.js";import{a as Ce}from"./chunk-HR5WLTC4.js";import{a as fe}from"./chunk-FCHZ7VUL.js";import"./chunk-BYXBJQAS.js";import{h as se,i as ce}from"./chunk-6IFNMT72.js";import"./chunk-4KJRE3GP.js";import{b as ue}from"./chunk-5233FXFY.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{C as de,D as pe,E as me,u as re,v as ae,w as le}from"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{P as F}from"./chunk-YJVLRBSS.js";import"./chunk-B4243VJD.js";import"./chunk-7COMDF6M.js";import"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import{C as ee,D as oe,E as te,c as z,e as _,h as J,i as Y,p as X,t as Q,u as Z}from"./chunk-LNLGRZBB.js";import"./chunk-DMSBV63C.js";import"./chunk-MAFIFJSJ.js";import{a as w,d as ie}from"./chunk-MP62IGYR.js";import"./chunk-J6RZLLDH.js";import{$a as l,$c as L,Db as f,Dc as q,E as N,Eb as A,Gb as O,Hb as U,Ib as n,Jb as i,Kb as s,Ma as D,Md as B,Nb as H,Nc as K,Ob as T,Qb as v,Rb as h,Td as W,Uc as R,Wd as ne,db as c,dc as $,ec as a,fc as G,gc as I,hd as M,kb as E,na as g,ob as V,pc as b,qb as u,qc as j,t as k,va as P,vb as m,wa as y}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";var x=r=>({"is-invalid":r});function Pe(r,d){r&1&&(n(0,"div",16),a(1," Provider Name is required "),i())}function ye(r,d){r&1&&(n(0,"div",20),a(1," Validate Coupon URL is required "),i())}function Ee(r,d){r&1&&(n(0,"div",20),a(1," Redeem Coupon URL is required "),i())}function Ge(r,d){r&1&&(n(0,"div",20),a(1,"Key is required"),i())}var S=class r{constructor(d){this.data=d;this.config=new de,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=g(re);config;fb=g(ee);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[_.required]],validateCoupon:[this.data?.validateCoupon||"",[_.required]],redeemCoupon:[this.data?.redeemCoupon||"",[_.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[_.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||r)(c(ae))};static \u0275cmp=E({type:r,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(n(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),n(11,"label",10),a(12,"Coupon Provider"),i()()(),n(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),i(),n(17,"label",15),a(18,"Enabled"),i()()()(),u(19,Pe,2,0,"div",16),i(),n(20,"div",17),s(21,"input",18),n(22,"label",19),a(23,"Validate Coupon URL"),i(),u(24,ye,2,0,"div",20),i(),n(25,"div",17),s(26,"input",21),n(27,"label",22),a(28,"Redeem Coupon URL"),i(),u(29,Ee,2,0,"div",20),i(),n(30,"div",23),s(31,"textarea",24),n(32,"label",25),a(33,"Request Header (Key: value)"),i(),u(34,Ge,2,0,"div",20),i()()()()()()()),e&2&&(m("config",o.config),l(5),m("formGroup",o.formGroup),l(5),m("ngClass",b(10,x,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),f(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),m("ngClass",b(12,x,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),f(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),m("ngClass",b(14,x,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),f(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),m("ngClass",b(16,x,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),f(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,te,X,z,J,Y,Q,Z,me,pe,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(r,d)=>({"bg-success-subtle text-success-emphasis":r,"bg-danger-subtle text-danger-emphasis":d});function Me(r,d){if(r&1){let e=T();n(0,"tr")(1,"td",10)(2,"i",11),v("click",function(){let t=P(e).$index,p=h(2);return y(p.onDeleteProvider(t))}),i()(),n(3,"td")(4,"a",12),v("click",function(){let t=P(e),p=t.$implicit,C=t.$index,he=h(2);return y(he.onUpdateProvider(p,C))}),a(5),i()(),n(6,"td"),a(7),i(),n(8,"td"),a(9),i(),n(10,"td"),a(11),i(),n(12,"td")(13,"span",13),a(14),i()()()}if(r&2){let e=d.$implicit;l(5),I(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),m("ngClass",j(6,Re,e.Enabled,!e.Enabled)),l(),I(" ",e.Enabled?"Enabled":"Disabled"," ")}}function xe(r,d){if(r&1&&O(0,Me,15,9,"tr",null,A),r&2){let e=h();U(e.listProviders())}}function Ne(r,d){r&1&&H(0)}function Te(r,d){if(r&1&&u(0,Ne,1,0,"ng-container",14),r&2){h();let e=$(26);m("ngTemplateOutlet",e)}}function Ie(r,d){r&1&&(n(0,"tr",15)(1,"td",16),s(2,"empty-state-table"),i()())}var ge=class r extends Ce{constructor(e,o,t,p,C){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=p;this.dialog=C}toastr=g(W);couponProviders=D([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let p={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(C=>(C[o]=p,[...C])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||r)(c(ue),c(ne),c(B),c(ie),c(le))};static \u0275cmp=E({type:r,selectors:[["app-coupon-configuration"]],features:[V],decls:27,vars:4,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1){let p=T();n(0,"mainpanel-cmp",1)(1,"actions")(2,"button",2),v("click",function(){return P(p),y(t.addNewCouponProvider())}),a(3," Add "),i()(),n(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"table",6)(9,"thead",7)(10,"tr"),s(11,"th",8),n(12,"th",9),a(13,"Name"),i(),n(14,"th"),a(15,"Validate Coupon"),i(),n(16,"th"),a(17,"Redeem Coupon"),i(),n(18,"th"),a(19,"Value"),i(),n(20,"th"),a(21,"Status"),i()()(),n(22,"tbody"),u(23,xe,2,0)(24,Te,1,1,"ng-container"),i()()()()(),u(25,Ie,3,0,"ng-template",null,0,q),i()()}if(o&2){let p;m("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(23),f(((p=t.listProviders())==null?null:p.length)>0?23:24)}},dependencies:[M,R,L,ce,se,oe,fe],encapsulation:2})};export{ge as CouponConfigurationComponent};