dealpos 25.24.4 → 25.24.6

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 (79) hide show
  1. package/browser/{chunk-2GI6ZSAJ.js → chunk-2C5K6SXH.js} +1 -1
  2. package/browser/{chunk-MV3F7T4B.js → chunk-2O2RFXOA.js} +2 -2
  3. package/browser/{chunk-7RXJRPDL.js → chunk-2SYD5HCW.js} +1 -1
  4. package/browser/{chunk-UPDYAX65.js → chunk-3UGVTGFJ.js} +1 -1
  5. package/browser/{chunk-4CDD54SD.js → chunk-4ERA7BSK.js} +2 -2
  6. package/browser/{chunk-YIANW5P7.js → chunk-4F2G3GZV.js} +2 -2
  7. package/browser/{chunk-HWPDTB73.js → chunk-4T6FQ3KR.js} +1 -1
  8. package/browser/{chunk-U3JZ2P6Z.js → chunk-4TJ55SYP.js} +1 -1
  9. package/browser/{chunk-A57NBJSX.js → chunk-5ILSHBSK.js} +1 -1
  10. package/browser/{chunk-FEH5GG3W.js → chunk-65F7Q2KD.js} +1 -1
  11. package/browser/{chunk-F2TBEUB7.js → chunk-6JK7PKFP.js} +1 -1
  12. package/browser/chunk-A3EBOVBV.js +1 -0
  13. package/browser/{chunk-KGIJSBLC.js → chunk-AIN6SDES.js} +1 -1
  14. package/browser/{chunk-J5SWKJ7Z.js → chunk-BCKU2YOQ.js} +1 -1
  15. package/browser/{chunk-RLCK7PSX.js → chunk-BGUJGVTK.js} +1 -1
  16. package/browser/{chunk-PSE5BXLQ.js → chunk-BK422ZYG.js} +1 -1
  17. package/browser/{chunk-JJ6FVE3Q.js → chunk-BNPUVQW4.js} +1 -1
  18. package/browser/{chunk-P3BQRKTA.js → chunk-BQYW6RTO.js} +1 -1
  19. package/browser/{chunk-6EOQRL3Y.js → chunk-CR2Q3DRH.js} +1 -1
  20. package/browser/{chunk-KSRNNVS4.js → chunk-D4KGTETV.js} +1 -1
  21. package/browser/{chunk-F5BUTBVM.js → chunk-E24ZFG7W.js} +1 -1
  22. package/browser/{chunk-XVGEP2S2.js → chunk-E7F7AZBX.js} +1 -1
  23. package/browser/{chunk-QKJDFNH5.js → chunk-EHAWYQX6.js} +1 -1
  24. package/browser/{chunk-2KPFWNU2.js → chunk-EK4RLRLU.js} +1 -1
  25. package/browser/{chunk-SNNXT3K5.js → chunk-EQWEKKGY.js} +2 -2
  26. package/browser/{chunk-A4EYZJD6.js → chunk-FCTDNFTK.js} +1 -1
  27. package/browser/{chunk-BLZHDHGU.js → chunk-FDQNICGJ.js} +1 -1
  28. package/browser/{chunk-BQJ6F5I3.js → chunk-FGPRYCGV.js} +2 -2
  29. package/browser/{chunk-LBXXLUMF.js → chunk-FWNMILHC.js} +1 -1
  30. package/browser/{chunk-KNUZSHDK.js → chunk-GCIFHN7B.js} +1 -1
  31. package/browser/{chunk-ALWAASHZ.js → chunk-GHA3YGXL.js} +1 -1
  32. package/browser/{chunk-SLBBK6EG.js → chunk-GXJFZ7TS.js} +1 -1
  33. package/browser/{chunk-XRDPI3HR.js → chunk-HZQLTMV2.js} +1 -1
  34. package/browser/{chunk-4JQ4RZVC.js → chunk-IAFFKB7Q.js} +1 -1
  35. package/browser/{chunk-VWDO3YUQ.js → chunk-IFOLQ7Q4.js} +1 -1
  36. package/browser/{chunk-CFBAROPM.js → chunk-ILOSUGZZ.js} +1 -1
  37. package/browser/{chunk-7KKNFBWZ.js → chunk-IMDKAIJV.js} +1 -1
  38. package/browser/{chunk-AXXBRGGG.js → chunk-IMVACDOW.js} +2 -2
  39. package/browser/{chunk-QFMJGDNH.js → chunk-J2POSKRZ.js} +1 -1
  40. package/browser/{chunk-SU6A4AJZ.js → chunk-JD4FCLAK.js} +2 -2
  41. package/browser/{chunk-R7HJRY7S.js → chunk-JXV3ZLNW.js} +1 -1
  42. package/browser/{chunk-KTTE33QH.js → chunk-KAIONFV6.js} +1 -1
  43. package/browser/{chunk-QHMOMSTP.js → chunk-KD2Y46ZB.js} +1 -1
  44. package/browser/{chunk-G4OW7TTY.js → chunk-KF2FWZOY.js} +1 -1
  45. package/browser/{chunk-42RT3HIU.js → chunk-KVNR7LE3.js} +1 -1
  46. package/browser/{chunk-FY4DKO2J.js → chunk-LGDME643.js} +1 -1
  47. package/browser/{chunk-EXF5Z6EN.js → chunk-LIO56WYO.js} +1 -1
  48. package/browser/{chunk-MQZ266XH.js → chunk-LKPECDHJ.js} +1 -1
  49. package/browser/{chunk-LFPYC45D.js → chunk-M43WDRZ2.js} +1 -1
  50. package/browser/{chunk-CYBHNQJV.js → chunk-MC6MSYXL.js} +1 -1
  51. package/browser/{chunk-ERPJ7GH4.js → chunk-MQ7LIFRW.js} +1 -1
  52. package/browser/{chunk-PNIEJU23.js → chunk-NDDV2Y7I.js} +1 -1
  53. package/browser/{chunk-XAAVXY2Q.js → chunk-NZW336DF.js} +1 -1
  54. package/browser/{chunk-DEWZ7AIG.js → chunk-OBRL3RNP.js} +1 -1
  55. package/browser/{chunk-2DPTW3RZ.js → chunk-OTKZ6NIX.js} +1 -1
  56. package/browser/{chunk-IDXACBYG.js → chunk-PGSUBMZF.js} +1 -1
  57. package/browser/{chunk-GNPWF36F.js → chunk-PMBD5Q3J.js} +1 -1
  58. package/browser/{chunk-GKCY2EQ5.js → chunk-R5HGAERV.js} +1 -1
  59. package/browser/{chunk-NTNBUOQI.js → chunk-RHB3RGSX.js} +1 -1
  60. package/browser/{chunk-D2LQH7GO.js → chunk-RNRUOCBB.js} +1 -1
  61. package/browser/{chunk-SZRMUXQ6.js → chunk-S7CLGKH3.js} +1 -1
  62. package/browser/{chunk-XBL27GUL.js → chunk-SXKTYIEX.js} +1 -1
  63. package/browser/{chunk-KBRD2A6T.js → chunk-T3M7NJFE.js} +3 -3
  64. package/browser/{chunk-M5KEQYPQ.js → chunk-T6RIUF52.js} +1 -1
  65. package/browser/{chunk-DLYNBREF.js → chunk-TC5YT6KF.js} +1 -1
  66. package/browser/{chunk-TJKV5B3A.js → chunk-UBP6VE6T.js} +1 -1
  67. package/browser/{chunk-3RQAFDS5.js → chunk-VHPR3WDH.js} +1 -1
  68. package/browser/{chunk-SYLUKDQF.js → chunk-VSLMAD6U.js} +1 -1
  69. package/browser/{chunk-Q7IR7G3G.js → chunk-VUEBPQ7B.js} +1 -1
  70. package/browser/{chunk-WC5VOWM4.js → chunk-VUQYK4SJ.js} +1 -1
  71. package/browser/{chunk-Z7WQCBZ5.js → chunk-VX7JALV7.js} +1 -1
  72. package/browser/{chunk-3XCLQS5K.js → chunk-Y2LVLBOC.js} +1 -1
  73. package/browser/{chunk-AU4DGLOO.js → chunk-YCZBTC7H.js} +1 -1
  74. package/browser/{chunk-G3MOO2SL.js → chunk-YUFPB7RC.js} +1 -1
  75. package/browser/{chunk-BN6GXFBL.js → chunk-YX4RHND4.js} +1 -1
  76. package/browser/index.html +2 -2
  77. package/browser/{main-RXH6V66Y.js → main-ARW464AQ.js} +2 -2
  78. package/package.json +1 -1
  79. package/browser/chunk-WFAPS7XT.js +0 -1
@@ -1 +1 @@
1
- import{a as de}from"./chunk-HWPDTB73.js";import{h as me,i as se}from"./chunk-GNPWF36F.js";import"./chunk-3RQAFDS5.js";import{b as le}from"./chunk-7RXJRPDL.js";import"./chunk-RZN6NBPT.js";import"./chunk-CJJZJDMF.js";import{C as ae,D as ne,E as re,u as te,v as ie,w as oe}from"./chunk-DG336IKR.js";import"./chunk-ZK4PRXMK.js";import"./chunk-OTTXNYU5.js";import"./chunk-LAO3WZ2T.js";import"./chunk-KAD4FFMP.js";import{a as ee}from"./chunk-2FWFPV5I.js";import"./chunk-XQ7RY4AB.js";import{C as X,D as Z,c as G,h as z,o as J,y as Q}from"./chunk-L57WBNZV.js";import"./chunk-XAAVXY2Q.js";import"./chunk-Q7IR7G3G.js";import{a as W}from"./chunk-4CRH5QZU.js";import"./chunk-KGIJSBLC.js";import{a as $}from"./chunk-D2UWUEGL.js";import{Cb as F,E as A,Hb as o,Ib as a,Jb as w,Kb as T,La as Y,Lb as g,Md as H,Nb as y,Pb as _,Qb as u,Tc as U,Td as q,Vc as j,Wc as v,_a as m,cb as f,cc as O,dc as r,dd as K,ec as R,fc as x,gd as h,ic as E,jb as b,jc as M,kc as P,nb as L,oc as D,pb as S,ua as d,ub as c,va as p,wc as k,xc as B}from"./chunk-2PTKV6NN.js";import"./chunk-7DCB7DB2.js";var I=(s=>(s.TRANSACTIONS="TRANSACTIONS",s.PRODUCTS="PRODUCTS",s.CONTACTS="CONTACTS",s.LOYALTY_POINTS="LOYALTY_POINTS",s.RECYCLE_BIN="RECYCLE_BIN",s.INVENTORY="INVENTORY",s))(I||{});function _e(n,l){if(n&1&&(T(0),o(1,"div",4)(2,"div",5)(3,"div",16),w(4,"i",17),o(5,"span"),r(6),a()()()(),g()),n&2){let i=u();m(6),x(" ",i.selectedClearData.message," ")}}function Se(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Subdomain is required "),a(),g())}function Te(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Password is required "),a(),g())}function ge(n,l){n&1&&w(0,"i",14)}function be(n,l){n&1&&w(0,"i",15)}var N=class n{constructor(l,i,t){this.data=l;this.dialogRef=i;this.fb=t;this.modalConfig.title=this.modalTitle[this.data.type],this.subdomain="",this.subdomainPlaceholder=l.subDomain}clearData=[{type:"TRANSACTIONS",api:"Setup/Data/ClearTransaction",message:"Your Invoice, Bill, Adjustment, TransferOrder will be deleted"},{type:"PRODUCTS",api:"Setup/Data/ClearProduct",message:"Your Category, Product and Variant will be deleted"},{type:"LOYALTY_POINTS",api:"Setup/Data/ClearLoyaltyPoint"},{type:"RECYCLE_BIN",api:"Setup/Data/ClearRecycleBin"},{type:"INVENTORY",api:"Setup/Data/ClearInventory",message:"Your Product Inventory will be set to 0"},{type:"CONTACTS",api:"Setup/Data/ClearContact",message:"Your Customer, Supplier and Sales Person will be deleted"}];selectedClearData;modalConfig=new ae;modalTitle={TRANSACTIONS:"Clear Transactions",PRODUCTS:"Clear Products",LOYALTY_POINTS:"Clear Loyalty Points",RECYCLE_BIN:"Clear Recycle Bin",CONTACTS:"Clear Contacts",INVENTORY:"Clear Inventory"};subdomain;subdomainPlaceholder;password;form;passwordVisibility=Y(!1);ngOnInit(){this.initSelectedClearData(),this.form=this.fb.group({subdomain:[""],password:[""]})}initSelectedClearData(){this.selectedClearData=this.clearData.find(l=>l.type===this.data.type)}onSubmit(){let l={password:this.password,subdomain:this.subdomain,apiUrl:this.selectedClearData.api};this.dialogRef.close(l)}static \u0275fac=function(i){return new(i||n)(f(ie),f(te),f(X))};static \u0275cmp=b({type:n,selectors:[["app-confirmation-modal"]],decls:24,vars:10,consts:[["subdomainCtrl","ngModel"],["passwordCtrl","ngModel"],[3,"onOk","onClose","onCancel","config","dynamicValidated"],[4,"ngIf"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mt-5"],["type","text","id","subdomain","placeholder","Subdomain","name","subdomain","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"form-floating-outline"],["id","pass","placeholder","Password","name","password","required","",1,"form-control",3,"ngModelChange","type","ngModel"],["for","pass"],[1,"password-visibility"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-eye"],[1,"fa-solid","fa-eye-slash"],[1,"alert","alert-warning","cursor","w-100"],[1,"fa-solid","fa-circle-exclamation","me-2"],[1,"control-label","text-danger"]],template:function(i,t){if(i&1){let e=y();o(0,"modal-material",2),_("onOk",function(){return d(e),p(t.onSubmit())})("onClose",function(){return d(e),p(t.dialogRef.close())})("onCancel",function(){return d(e),p(t.dialogRef.close())}),o(1,"content"),S(2,_e,7,1,"ng-container",3),o(3,"div",4)(4,"div",5)(5,"strong"),r(6),a(),o(7,"div",6)(8,"input",7,0),P("ngModelChange",function(s){return d(e),M(t.subdomain,s)||(t.subdomain=s),p(s)}),a(),o(10,"label",8),r(11,"Subdomain"),a(),S(12,Se,3,0,"ng-container",3),a()(),o(13,"div",5)(14,"div",9)(15,"input",10,1),P("ngModelChange",function(s){return d(e),M(t.password,s)||(t.password=s),p(s)}),a(),o(17,"label",11),r(18,"Password"),a(),S(19,Te,3,0,"ng-container",3),o(20,"div",12)(21,"button",13),_("click",function(){return d(e),p(t.passwordVisibility.set(!t.passwordVisibility()))}),S(22,ge,1,0,"i",14)(23,be,1,0,"i",15),a()()()()()()()}if(i&2){let e=O(9),C=O(16);c("config",t.modalConfig)("dynamicValidated",t.password&&t.subdomain),m(2),c("ngIf",t.selectedClearData.message),m(4),x("Enter the following subdomain to confirm: ",t.subdomainPlaceholder,""),m(2),E("ngModel",t.subdomain),m(4),c("ngIf",e.invalid&&(e.dirty||e.touched)),m(3),c("type",t.passwordVisibility()?"text":"password"),E("ngModel",t.password),m(4),c("ngIf",C.invalid&&(C.dirty||C.touched)),m(3),F(t.passwordVisibility()?22:23)}},dependencies:[h,v,re,ne,Z,G,z,Q,J],styles:[".password-visibility[_ngcontent-%COMP%]{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;font-size:1.5rem}"]})};var V=n=>({"border border-0":n});function we(n,l){if(n&1&&(T(0),o(1,"tr",23)(2,"td",23),r(3),a(),o(4,"td",24),r(5),k(6,"number"),a()(),g()),n&2){let i=l.$implicit,t=l.index,e=u(2);m(),c("ngClass",D(7,V,t==e.data.Data.length-1)),m(),c("ngClass",D(9,V,t==e.data.Data.length-1)),m(),R(i.Key),m(),c("ngClass",D(11,V,t==e.data.Data.length-1)),m(),R(B(6,5,i.Value))}}function ye(n,l){if(n&1){let i=y();o(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"div",3)(4,"button",4),r(5," Format Data "),a(),o(6,"ul",5)(7,"li")(8,"a",6),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.TRANSACTIONS))}),r(9," 1. Clear Transactions "),a()(),o(10,"li")(11,"a",7),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.INVENTORY))}),r(12," 2. Clear Inventory "),a()(),o(13,"li")(14,"a",8),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.PRODUCTS))}),r(15," 3. Clear Products "),a()(),o(16,"li")(17,"a",9),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.CONTACTS))}),r(18," 4. Clear Contacts "),a()(),o(19,"li")(20,"a",10),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.LOYALTY_POINTS))}),r(21," 5. Clear Loyalty Point "),a()(),o(22,"li")(23,"a",11),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.RECYCLE_BIN))}),r(24," 6. Clear Recycle Bin "),a()()()()()(),o(25,"content")(26,"div",12)(27,"div",13)(28,"div",14)(29,"h5"),r(30,"Database Records"),a(),o(31,"i"),r(32,"Current data count"),a()(),o(33,"div",15)(34,"div",16)(35,"div",17)(36,"table",18)(37,"thead",19)(38,"tr",20)(39,"th"),r(40,"Table"),a(),o(41,"th",21),r(42,"Rows"),a()()(),o(43,"tbody"),S(44,we,7,13,"ng-container",22),a()()()()()()()()()}if(n&2){let i=u();c("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),m(44),c("ngForOf",i.data.Data)}}var pe=class n extends de{constructor(i,t,e,C,s){super(i,t,"Setup/DataLoader/clearformatdata",e);this.httpService=t;this.activatedRoute=e;this.toaster=C;this.dialog=s}clearDataType=I;onClearRecord(i){this.dialog.open(N,{data:{type:i,subDomain:this.data.SubDomain}}).afterClosed().pipe(A(t=>W.IsNotEmpty(t))).subscribe(t=>{this.formData={Subdomain:t.subdomain,Password:t.password},this.onSubmit(t.apiUrl),i=="PRODUCTS"?this.data.Data.find(e=>e.Key=="Product").Value=0:i=="CONTACTS"?this.data.Data.find(e=>e.Key=="Customer").Value=0:i=="INVENTORY"?this.data.Data.find(e=>e.Key=="ItemTransfer").Value=0:i=="LOYALTY_POINTS"?this.data.Data.find(e=>e.Key=="JournalHeader").Value=0:i=="RECYCLE_BIN"?this.data.Data.find(e=>e.Key=="Recycle Bin").Value=0:i=="TRANSACTIONS"&&(this.data.Data.find(e=>e.Key=="SalesOrder").Value=0)})}onSubmitSuccess(i){this.toaster.success(i.Message,ee.Success)}static \u0275fac=function(t){return new(t||n)(f(le),f($),f(H),f(q),f(oe))};static \u0275cmp=b({type:n,selectors:[["POS-format-data"]],features:[L],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false","confirm-message","Are you sure you want to clear the record?",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end"],["role","button","matTooltipPosition","above","matTooltip","Clear Transaction",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Inventory",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Products",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Contacts",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Loyalty Point",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Recycle Bin",1,"dropdown-item",3,"click"],[1,"container","pt-3"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-md-12"],["id","tableGrid",1,"table",2,"width","250px"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-end",3,"ngClass"]],template:function(t,e){t&1&&S(0,ye,45,4,"mainpanel-cmp",0),t&2&&c("ngIf",e.formData)},dependencies:[h,U,j,v,K,se,me],encapsulation:2})};export{pe as FormatDataComponent};
1
+ import{a as de}from"./chunk-4T6FQ3KR.js";import{h as me,i as se}from"./chunk-PMBD5Q3J.js";import"./chunk-VHPR3WDH.js";import{b as le}from"./chunk-2SYD5HCW.js";import"./chunk-RZN6NBPT.js";import"./chunk-CJJZJDMF.js";import{C as ae,D as ne,E as re,u as te,v as ie,w as oe}from"./chunk-DG336IKR.js";import"./chunk-ZK4PRXMK.js";import"./chunk-OTTXNYU5.js";import"./chunk-LAO3WZ2T.js";import"./chunk-KAD4FFMP.js";import{a as ee}from"./chunk-2FWFPV5I.js";import"./chunk-XQ7RY4AB.js";import{C as X,D as Z,c as G,h as z,o as J,y as Q}from"./chunk-L57WBNZV.js";import"./chunk-NZW336DF.js";import"./chunk-VUEBPQ7B.js";import{a as W}from"./chunk-4CRH5QZU.js";import"./chunk-AIN6SDES.js";import{a as $}from"./chunk-D2UWUEGL.js";import{Cb as F,E as A,Hb as o,Ib as a,Jb as w,Kb as T,La as Y,Lb as g,Md as H,Nb as y,Pb as _,Qb as u,Tc as U,Td as q,Vc as j,Wc as v,_a as m,cb as f,cc as O,dc as r,dd as K,ec as R,fc as x,gd as h,ic as E,jb as b,jc as M,kc as P,nb as L,oc as D,pb as S,ua as d,ub as c,va as p,wc as k,xc as B}from"./chunk-2PTKV6NN.js";import"./chunk-7DCB7DB2.js";var I=(s=>(s.TRANSACTIONS="TRANSACTIONS",s.PRODUCTS="PRODUCTS",s.CONTACTS="CONTACTS",s.LOYALTY_POINTS="LOYALTY_POINTS",s.RECYCLE_BIN="RECYCLE_BIN",s.INVENTORY="INVENTORY",s))(I||{});function _e(n,l){if(n&1&&(T(0),o(1,"div",4)(2,"div",5)(3,"div",16),w(4,"i",17),o(5,"span"),r(6),a()()()(),g()),n&2){let i=u();m(6),x(" ",i.selectedClearData.message," ")}}function Se(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Subdomain is required "),a(),g())}function Te(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Password is required "),a(),g())}function ge(n,l){n&1&&w(0,"i",14)}function be(n,l){n&1&&w(0,"i",15)}var N=class n{constructor(l,i,t){this.data=l;this.dialogRef=i;this.fb=t;this.modalConfig.title=this.modalTitle[this.data.type],this.subdomain="",this.subdomainPlaceholder=l.subDomain}clearData=[{type:"TRANSACTIONS",api:"Setup/Data/ClearTransaction",message:"Your Invoice, Bill, Adjustment, TransferOrder will be deleted"},{type:"PRODUCTS",api:"Setup/Data/ClearProduct",message:"Your Category, Product and Variant will be deleted"},{type:"LOYALTY_POINTS",api:"Setup/Data/ClearLoyaltyPoint"},{type:"RECYCLE_BIN",api:"Setup/Data/ClearRecycleBin"},{type:"INVENTORY",api:"Setup/Data/ClearInventory",message:"Your Product Inventory will be set to 0"},{type:"CONTACTS",api:"Setup/Data/ClearContact",message:"Your Customer, Supplier and Sales Person will be deleted"}];selectedClearData;modalConfig=new ae;modalTitle={TRANSACTIONS:"Clear Transactions",PRODUCTS:"Clear Products",LOYALTY_POINTS:"Clear Loyalty Points",RECYCLE_BIN:"Clear Recycle Bin",CONTACTS:"Clear Contacts",INVENTORY:"Clear Inventory"};subdomain;subdomainPlaceholder;password;form;passwordVisibility=Y(!1);ngOnInit(){this.initSelectedClearData(),this.form=this.fb.group({subdomain:[""],password:[""]})}initSelectedClearData(){this.selectedClearData=this.clearData.find(l=>l.type===this.data.type)}onSubmit(){let l={password:this.password,subdomain:this.subdomain,apiUrl:this.selectedClearData.api};this.dialogRef.close(l)}static \u0275fac=function(i){return new(i||n)(f(ie),f(te),f(X))};static \u0275cmp=b({type:n,selectors:[["app-confirmation-modal"]],decls:24,vars:10,consts:[["subdomainCtrl","ngModel"],["passwordCtrl","ngModel"],[3,"onOk","onClose","onCancel","config","dynamicValidated"],[4,"ngIf"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mt-5"],["type","text","id","subdomain","placeholder","Subdomain","name","subdomain","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"form-floating-outline"],["id","pass","placeholder","Password","name","password","required","",1,"form-control",3,"ngModelChange","type","ngModel"],["for","pass"],[1,"password-visibility"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-eye"],[1,"fa-solid","fa-eye-slash"],[1,"alert","alert-warning","cursor","w-100"],[1,"fa-solid","fa-circle-exclamation","me-2"],[1,"control-label","text-danger"]],template:function(i,t){if(i&1){let e=y();o(0,"modal-material",2),_("onOk",function(){return d(e),p(t.onSubmit())})("onClose",function(){return d(e),p(t.dialogRef.close())})("onCancel",function(){return d(e),p(t.dialogRef.close())}),o(1,"content"),S(2,_e,7,1,"ng-container",3),o(3,"div",4)(4,"div",5)(5,"strong"),r(6),a(),o(7,"div",6)(8,"input",7,0),P("ngModelChange",function(s){return d(e),M(t.subdomain,s)||(t.subdomain=s),p(s)}),a(),o(10,"label",8),r(11,"Subdomain"),a(),S(12,Se,3,0,"ng-container",3),a()(),o(13,"div",5)(14,"div",9)(15,"input",10,1),P("ngModelChange",function(s){return d(e),M(t.password,s)||(t.password=s),p(s)}),a(),o(17,"label",11),r(18,"Password"),a(),S(19,Te,3,0,"ng-container",3),o(20,"div",12)(21,"button",13),_("click",function(){return d(e),p(t.passwordVisibility.set(!t.passwordVisibility()))}),S(22,ge,1,0,"i",14)(23,be,1,0,"i",15),a()()()()()()()}if(i&2){let e=O(9),C=O(16);c("config",t.modalConfig)("dynamicValidated",t.password&&t.subdomain),m(2),c("ngIf",t.selectedClearData.message),m(4),x("Enter the following subdomain to confirm: ",t.subdomainPlaceholder,""),m(2),E("ngModel",t.subdomain),m(4),c("ngIf",e.invalid&&(e.dirty||e.touched)),m(3),c("type",t.passwordVisibility()?"text":"password"),E("ngModel",t.password),m(4),c("ngIf",C.invalid&&(C.dirty||C.touched)),m(3),F(t.passwordVisibility()?22:23)}},dependencies:[h,v,re,ne,Z,G,z,Q,J],styles:[".password-visibility[_ngcontent-%COMP%]{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;font-size:1.5rem}"]})};var V=n=>({"border border-0":n});function we(n,l){if(n&1&&(T(0),o(1,"tr",23)(2,"td",23),r(3),a(),o(4,"td",24),r(5),k(6,"number"),a()(),g()),n&2){let i=l.$implicit,t=l.index,e=u(2);m(),c("ngClass",D(7,V,t==e.data.Data.length-1)),m(),c("ngClass",D(9,V,t==e.data.Data.length-1)),m(),R(i.Key),m(),c("ngClass",D(11,V,t==e.data.Data.length-1)),m(),R(B(6,5,i.Value))}}function ye(n,l){if(n&1){let i=y();o(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"div",3)(4,"button",4),r(5," Format Data "),a(),o(6,"ul",5)(7,"li")(8,"a",6),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.TRANSACTIONS))}),r(9," 1. Clear Transactions "),a()(),o(10,"li")(11,"a",7),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.INVENTORY))}),r(12," 2. Clear Inventory "),a()(),o(13,"li")(14,"a",8),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.PRODUCTS))}),r(15," 3. Clear Products "),a()(),o(16,"li")(17,"a",9),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.CONTACTS))}),r(18," 4. Clear Contacts "),a()(),o(19,"li")(20,"a",10),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.LOYALTY_POINTS))}),r(21," 5. Clear Loyalty Point "),a()(),o(22,"li")(23,"a",11),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.RECYCLE_BIN))}),r(24," 6. Clear Recycle Bin "),a()()()()()(),o(25,"content")(26,"div",12)(27,"div",13)(28,"div",14)(29,"h5"),r(30,"Database Records"),a(),o(31,"i"),r(32,"Current data count"),a()(),o(33,"div",15)(34,"div",16)(35,"div",17)(36,"table",18)(37,"thead",19)(38,"tr",20)(39,"th"),r(40,"Table"),a(),o(41,"th",21),r(42,"Rows"),a()()(),o(43,"tbody"),S(44,we,7,13,"ng-container",22),a()()()()()()()()()}if(n&2){let i=u();c("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),m(44),c("ngForOf",i.data.Data)}}var pe=class n extends de{constructor(i,t,e,C,s){super(i,t,"Setup/DataLoader/clearformatdata",e);this.httpService=t;this.activatedRoute=e;this.toaster=C;this.dialog=s}clearDataType=I;onClearRecord(i){this.dialog.open(N,{data:{type:i,subDomain:this.data.SubDomain}}).afterClosed().pipe(A(t=>W.IsNotEmpty(t))).subscribe(t=>{this.formData={Subdomain:t.subdomain,Password:t.password},this.onSubmit(t.apiUrl),i=="PRODUCTS"?this.data.Data.find(e=>e.Key=="Product").Value=0:i=="CONTACTS"?this.data.Data.find(e=>e.Key=="Customer").Value=0:i=="INVENTORY"?this.data.Data.find(e=>e.Key=="ItemTransfer").Value=0:i=="LOYALTY_POINTS"?this.data.Data.find(e=>e.Key=="JournalHeader").Value=0:i=="RECYCLE_BIN"?this.data.Data.find(e=>e.Key=="Recycle Bin").Value=0:i=="TRANSACTIONS"&&(this.data.Data.find(e=>e.Key=="SalesOrder").Value=0)})}onSubmitSuccess(i){this.toaster.success(i.Message,ee.Success)}static \u0275fac=function(t){return new(t||n)(f(le),f($),f(H),f(q),f(oe))};static \u0275cmp=b({type:n,selectors:[["POS-format-data"]],features:[L],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false","confirm-message","Are you sure you want to clear the record?",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end"],["role","button","matTooltipPosition","above","matTooltip","Clear Transaction",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Inventory",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Products",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Contacts",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Loyalty Point",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Recycle Bin",1,"dropdown-item",3,"click"],[1,"container","pt-3"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-md-12"],["id","tableGrid",1,"table",2,"width","250px"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-end",3,"ngClass"]],template:function(t,e){t&1&&S(0,ye,45,4,"mainpanel-cmp",0),t&2&&c("ngIf",e.formData)},dependencies:[h,U,j,v,K,se,me],encapsulation:2})};export{pe as FormatDataComponent};
@@ -1,4 +1,4 @@
1
- import{a as Yr,b as Zn}from"./chunk-WC5VOWM4.js";import{b as Gr,c as zr}from"./chunk-4BWXOLIW.js";import{a as Br}from"./chunk-RF47WLGG.js";import{b as Fr,e as jr,f as Hr,g as Ur}from"./chunk-SD7K34RH.js";import{a as ea}from"./chunk-GSLPZSSX.js";import{A as Dr,B as Qi,C as zt,D as qi,E as Rr,F as Nr,G as $i,H as Ar,I as Lr,a as mr,b as ct,c as gr,d as he,e as N,f as A,g as fr,h as me,i as _r,j as Cr,k as Y,l as br,m as hr,n as Pe,o as vr,p as $t,q as Le,r as Jt,s as Ai,t as Li,u as Bi,v as Mt,w as Xn,x as Fi,y as q,z as Mr}from"./chunk-BQJ6F5I3.js";import"./chunk-F6GAPEFT.js";import"./chunk-TK5H65DN.js";import"./chunk-6L6CIH5M.js";import"./chunk-JENBDDPJ.js";import{a as Zr}from"./chunk-CVTOBG53.js";import{a as $r,b as Jr}from"./chunk-G3MOO2SL.js";import{a as Or,b as xr,c as Ir,d as Hi}from"./chunk-U37IA35U.js";import{b as Xr}from"./chunk-35EIBQSG.js";import{a as dr}from"./chunk-HBNFET4C.js";import"./chunk-DHEQAB6U.js";import{b as Fe}from"./chunk-QNZDTLBV.js";import"./chunk-2IT6TVBI.js";import{a as wi}from"./chunk-VRV3OFCZ.js";import{a as Kr,b as Ki}from"./chunk-F56RRQ2D.js";import{a as wr,b as kr}from"./chunk-MSKXTGJV.js";import{c as Ui,d as Wi}from"./chunk-MBZ4X6KE.js";import"./chunk-E42HYMH5.js";import"./chunk-CWUYG4I7.js";import{a as Zo}from"./chunk-4TJP3I23.js";import{a as zi}from"./chunk-QJO2HEHQ.js";import"./chunk-RQPXOFKZ.js";import{a as Ae,b as pt}from"./chunk-QKJDFNH5.js";import"./chunk-SFH4OHUD.js";import{a as qr}from"./chunk-DQ6MBFAC.js";import{a as Gi}from"./chunk-XW55YDWI.js";import"./chunk-YGQY3ZO6.js";import"./chunk-SE7OFLAL.js";import"./chunk-73GZUVTA.js";import"./chunk-WLRXTHLM.js";import{a as ur,b as Tr,c as Er}from"./chunk-ARXCUZB7.js";import{a as Vi}from"./chunk-RGXISNHE.js";import{a as Vr}from"./chunk-LVPVFHNY.js";import"./chunk-OBQ3N46V.js";import"./chunk-KHIVRNUW.js";import"./chunk-D7J7QKYR.js";import"./chunk-6CWHLMOD.js";import"./chunk-ICTX5LEL.js";import{d as cr,e as pr}from"./chunk-LPG2RJLT.js";import"./chunk-F56IKJ5L.js";import"./chunk-3RK6DDJD.js";import"./chunk-I5GQBAR7.js";import"./chunk-BYXBJQAS.js";import{a as mi}from"./chunk-RO76NHEN.js";import{a as be,c as Ni}from"./chunk-J2H55XWI.js";import{a as Yn}from"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import{c as di}from"./chunk-NHG7IM7O.js";import{a as ki}from"./chunk-I4MJUIXL.js";import{a as Ei,b as Ri}from"./chunk-CFBAROPM.js";import{a as Ji,b as Wr,c as Qr}from"./chunk-42BW7I7K.js";import"./chunk-OSZRROV7.js";import{a as Kn}from"./chunk-BGTI5KGX.js";import{a as yr,b as ji}from"./chunk-7UE6XABD.js";import{a as Gt,b as Sr}from"./chunk-3MNL3EI2.js";import"./chunk-GO2SAICT.js";import"./chunk-GV52FU6D.js";import"./chunk-F6236QM2.js";import{b as xi,c as xt,d as It,e as Ii}from"./chunk-HN6WDNY2.js";import"./chunk-S7ZNAMPJ.js";import{a as Pr}from"./chunk-KS3WKPHQ.js";import"./chunk-DWSWGVFO.js";import{b as Ti,c as tt}from"./chunk-HT35KHLT.js";import"./chunk-BYXBJQAS.js";import"./chunk-Y6QUFAXA.js";import{d as Mi,e as Di}from"./chunk-7Y2JH7DD.js";import{a as $o,b as Jo,c as Go}from"./chunk-B3BT3A2V.js";import"./chunk-R4BNPX7T.js";import"./chunk-PECLRH37.js";import"./chunk-UBVLAOUK.js";import"./chunk-EBC6YN66.js";import"./chunk-375PELC6.js";import{a as er}from"./chunk-CZDMIN7T.js";import"./chunk-NXF2KNQV.js";import{a as zo,d as Ko,f as Yo}from"./chunk-UWAYE735.js";import{a as ut,b as st}from"./chunk-M3ZVAEY4.js";import{a as sr}from"./chunk-3RQAFDS5.js";import{a as Xo,b as tr}from"./chunk-7RXJRPDL.js";import"./chunk-RZN6NBPT.js";import{a as Uo}from"./chunk-CJJZJDMF.js";import{C as W,D as Q,E as Qe,K as lr,L as Ie,N as qt,O as Pt,u as j,v as Ve,w as ne}from"./chunk-DG336IKR.js";import{M as Wo,Z as Qo,_ as qo,ga as de,ha as Ke}from"./chunk-ZK4PRXMK.js";import{G as ar,O as Pi,P as ae,a as ir,b as nr,n as Qt,v as or,y as rr}from"./chunk-OTTXNYU5.js";import{a as Ro}from"./chunk-BSKYOCR4.js";import"./chunk-GIKR6Y2K.js";import{a as et}from"./chunk-4JQ4RZVC.js";import{a as Ho}from"./chunk-LAO3WZ2T.js";import"./chunk-DHDHZ4XD.js";import"./chunk-KAD4FFMP.js";import{a as Be}from"./chunk-2FWFPV5I.js";import"./chunk-XQ7RY4AB.js";import{B as Fo,D as xe,E as ze,a as No,b as St,c as Z,d as Vo,e as pi,g as Ao,h as K,j as Lo,l as yt,m as Bo,o as ie,r as Oi,s as Ot,y as Ht}from"./chunk-L57WBNZV.js";import{a as jt,c as Wt}from"./chunk-XAAVXY2Q.js";import{a as jo}from"./chunk-Q7IR7G3G.js";import{a as S,d as Ut}from"./chunk-4CRH5QZU.js";import"./chunk-KGIJSBLC.js";import{a as Ne}from"./chunk-D2UWUEGL.js";import{$ as Oe,$c as Re,Aa as vo,Cb as B,Cc as H,E as se,Ea as He,Hb as r,Hc as Po,I as ai,Ia as hi,Ib as a,Ja as So,Jb as b,Kb as O,Kd as To,L as Co,La as ce,Lb as x,Mb as si,Md as Eo,Nb as v,Od as ht,Pb as f,Pc as Mo,Pd as vt,Qb as d,Rd as Ft,Tb as ci,Tc as J,Td as z,Ua as Bt,Ub as xo,Va as Ye,Vc as fe,Wc as U,X as Lt,Ya as Xe,Yb as De,Zb as we,Zc as Do,_a as s,_b as ke,_c as yi,bd as We,c as fo,ca as P,cb as m,cc as F,d as $,dc as p,dd as X,e as $n,ea as Ee,ec as T,fc as y,fd as wo,gc as Ue,gd as te,ha as bo,ia as Je,ic as D,ja as Ct,jb as M,jc as w,jd as ko,k as _o,kb as bt,kc as k,la as L,lb as vi,ma as pe,mc as at,nb as Si,nc as lt,o as Jn,oc as E,pb as _,pc as ye,qc as Io,t as rt,ta as ho,tb as yo,u as At,ua as u,ub as c,va as g,vb as Gn,wb as li,wc as h,xb as Oo,xc as I,yb as Ze,yc as re,zb as zn,zc as Ge}from"./chunk-2PTKV6NN.js";import{j as go}from"./chunk-7DCB7DB2.js";var Yi=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var Kt=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var Yt=class o{constructor(t,e,i,n,l,C){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=n;this.parkService=l;this.data=C;this.initModalDialog(),this.initConfig(),this.parkLabel=C.ParkLabel,this.form.ParkLabel=C.ParkLabel,this.form.Note=n.Data.Order.Note}modalConfig=new W;labelPlaceholder;form=new Kt;parkLabel;initConfig(){let t=this._posService.Data.AppConfigJSON;this.labelPlaceholder=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder}initModalDialog(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="600px"}onOk(){this.setParkTitle(),this.parkService.park(this.form).subscribe(t=>{this.dialogRef.close(!0)})}setParkTitle(){let t=this._orderProcessorService.Data.posState,e=this.salesOrderService.Data.Order.Number;t==5?this.salesOrderService.Data.SplitParkLabel=S.IsEmpty(this.parkLabel)?e:this.parkLabel:S.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||o)(m(j),m(q),m(A),m(N),m(Se),m(Ve))};static \u0275cmp=M({type:o,selectors:[["POS-modal-park-input"]],standalone:!1,decls:10,vars:4,consts:[[3,"onCancel","onOk","onClose","config"],[1,"w-100"],[1,"mb-3"],["type","text","required","","matTooltip","Same as Order Number when blank",1,"form-control","w-100","height-input",3,"ngModelChange","ngModel","placeholder"],[1,"w-100","mt-4"],["placeholder","ex: Customer will return tommorow",3,"valueChange","value"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("onCancel",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()})("onClose",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"strong",2),p(4,"Label"),a(),r(5,"input",3),k("ngModelChange",function(l){return w(i.parkLabel,l)||(i.parkLabel=l),l}),a()(),r(6,"div",4)(7,"strong",2),p(8,"Note"),a(),r(9,"POS-tinymce-editor",5),k("valueChange",function(l){return w(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(c("config",i.modalConfig),s(5),D("ngModel",i.parkLabel),c("placeholder",i.labelPlaceholder?i.labelPlaceholder:"Insert Initial for the order"),s(4),D("value",i.form.Note))},dependencies:[Z,K,Ht,ie,Q,de,Gt],styles:[".height-input[_ngcontent-%COMP%]{height:36px} ng-select.park-detail>div.ng-select-container{border-radius:0!important}.deposit[_ngcontent-%COMP%] .ng-select{width:auto!important}.ods-info-box[_ngcontent-%COMP%]{background-color:#e8f4fd;border-left:4px solid #0dcaf0;padding:16px 20px;border-radius:8px;font-family:Roboto Slab,sans-serif;color:#055160;display:flex;align-items:flex-start;gap:10px;font-size:14px;max-width:600px;margin:0 auto}"]})};var Xt=class{Name;Alias;IsOccupied};var xa=(o,t)=>({"text-danger":o,"text-success":t}),Ia=o=>({ID:o});function Pa(o,t){if(o&1&&(r(0,"span"),p(1),h(2,"limitTo"),a()),o&2){let e=d().$implicit,i=d(3);s(),T(i.parkLayoutPack.Layout.length<5?e.Name:re(2,1,e.Name,5))}}function Ma(o,t){if(o&1&&b(0,"span",23),o&2){let e=d().$implicit;c("innerHtml",e.Alias,Bt)}}function Da(o,t){if(o&1){let e=v();r(0,"div",14)(1,"div",15),f("click",function(){let n=u(e).$implicit,l=d(4);return g(l.onSelect(n))}),r(2,"div",16)(3,"h6",17),b(4,"i",18),p(5),h(6,"limitTo"),a(),r(7,"div",19)(8,"span",20),b(9,"i",21),a(),_(10,Ma,1,1,"span",22),a()()()()}if(o&2){let e=t.$implicit,i=d(4);s(),c("title",e.Name),s(),c("ngClass",i.getStatus(e.Name)),s(3),y(" ",re(6,5,e.Alias?e.Alias:e.Name,15)," "),s(3),c("ngClass",ye(8,xa,i.getNote(e.Name)=="OCCUPIED",i.getNote(e.Name)!="OCCUPIED")),s(2),c("ngIf",e.Alias&&!i.replaceWithAlias)}}function wa(o,t){if(o&1&&(r(0,"mat-tab"),_(1,Pa,3,4,"ng-template",10),r(2,"div",11)(3,"div",12),_(4,Da,11,11,"div",13),h(5,"Filter"),a()()()),o&2){let e=t.$implicit,i=d(3);s(4),c("ngForOf",Ge(5,1,e.Options,i.filter,"Name"))}}function ka(o,t){if(o&1&&(r(0,"mat-tab-group"),_(1,wa,6,5,"mat-tab",9),a()),o&2){let e=d(2);s(),c("ngForOf",e.parkLayoutPack.Layout)}}function Ta(o,t){if(o&1){let e=v();r(0,"div")(1,"div",4)(2,"span",5),b(3,"i",6),a(),r(4,"input",7),k("ngModelChange",function(n){u(e);let l=d();return w(l.filter,n)||(l.filter=n),g(n)}),a()(),_(5,ka,2,1,"mat-tab-group",8),a()}if(o&2){let e=d();s(4),D("ngModel",e.filter),s(),c("ngIf",e.parkLayoutPack.Layout)}}function Ea(o,t){if(o&1){let e=v();r(0,"div",24)(1,"h4"),p(2,"Please write Layout column inside Park Layout Template, "),r(3,"a",25),f("click",function(){u(e);let n=d();return g(n._dialogRef.close())}),p(4,"click here to setup the park layout"),a()()()}if(o&2){let e=d();s(3),c("queryParams",E(1,Ia,e.parkLayoutPack.ID))}}var Zt=class o{constructor(t,e,i,n,l,C,R,oe,Ce,dt,ot){this._dialogRef=t;this.data=e;this._orderHttpService=i;this._orderDataService=n;this._localData=l;this._posService=C;this._orderProcessorService=R;this._dialog=oe;this._toastr=Ce;this._outletService=dt;this.parkService=ot;this.parkLayoutPack=e.parkLayoutPack,this.qty=e.qty,this.replaceWithAlias=e.replaceWithAlias,this.entityId=e.entityId,this.occupied=e.occupied,this.totalOption=0,this.appConfigJson=this._posService.Data.AppConfigJSON,this.salesOrderData=this._orderDataService.Data,this.payments=this._outletService.Data.Payments,this.parkLayoutPack.Layout.forEach(je=>{this.totalOption+=je.Size,je.Options=[];for(let mt=1;mt<=je.Size;mt++){let _t=new Xt;_t.Name=je.Name+mt,_t.Alias=this.GetAlias(_t.Name),je.Options.push(_t)}})}modalConfig=new W;title;parkLayoutPack;entityId;occupied;houseKeeping;replaceWithAlias;filter;totalOption;qty;appConfigJson;salesOrderData;payments=[];ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="850px",this.modalConfig.hideFooter=!0,this.modalConfig.bodyScrollable=!0}GetAlias(t){if(this.parkLayoutPack.Alias){let e=this.parkLayoutPack.Alias.filter(i=>i.Name==t);if(e.length>0)return e[0].Alias}return""}onSelect(t){this.getStatus(t.Name)=="vacant"?this.submitToServer(t.Name):this._toastr.warning("Please choose another slot!",`${t.Name} - Occupied`)}submitToServer(t){if(this.appConfigJson.ApplicationParkAndRetrieve.NumberOfPerson||this.appConfigJson.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableNotes)this.openParkFormModal(t);else{let e=new Kt;e.ParkLabel=t,this._dialogRef.close(!0),this.parkService.park(e).subscribe(i=>{this._dialogRef.close(!0)})}}openParkFormModal(t){this._dialog.open(Yt,{data:{title:t,labelDisable:S.IsNotEmpty(this.parkLayoutPack.ID)||this._orderProcessorService.Data.posState==5,labelPlaceholder:this.appConfigJson.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder,listPayment:this.payments,ParkLabel:t||this.salesOrderData.Order.ParkLabel,note:this.salesOrderData.Order.Note,noteEnabled:this.appConfigJson.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableNotes,numberOfPerson:this.salesOrderData.Order.NumberOfPerson,numberOfPersonEnabled:this.appConfigJson.ApplicationParkAndRetrieve.NumberOfPerson},id:"park-form-modal"}).afterClosed().subscribe(e=>{e&&this._dialogRef.close(!0)})}getNote(t){let e=this.getStatus(t);return e=="preparing"?this.houseKeeping.filter(n=>n.Option==t)[0].Notes:e.toUpperCase()}getStatus(t){return this.occupied&&this.occupied.filter(i=>i.ParkLabel==t).length>0?"occupied":this.houseKeeping&&this.houseKeeping.filter(i=>i.Option==t).length>0?"preparing":"vacant"}static \u0275fac=function(e){return new(e||o)(m(j),m(Ve),m(he),m(N),m(Ie),m(A),m(q),m(ne),m(z),m(Y),m(Se))};static \u0275cmp=M({type:o,selectors:[["POS-modal-park-select"]],standalone:!1,decls:5,vars:3,consts:[["BLANK",""],[3,"onClose","onCancel","config"],[1,"park"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3",2,"width","200px"],[1,"input-group-text","txtFilter","pe-0"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0",3,"ngModelChange","ngModel"],[4,"ngIf"],[4,"ngFor","ngForOf"],["mat-tab-label",""],[1,"container","px-0"],[1,"row","dialogPicker"],["class","col-auto px-0",4,"ngFor","ngForOf"],[1,"col-auto","px-0"],[1,"card","mb-0",2,"width","135px",3,"click","title"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0","p-5","text-white","rounded","d-flex",2,"width","132px"],["aria-hidden","true",1,"fa","fa-circle-info","pe-3","mt-1"],[1,"card-text","text-center",2,"width","135px"],[1,"pt-4",3,"ngClass"],[1,"fa-solid","fa-chair"],["class","alias",3,"innerHtml",4,"ngIf"],[1,"alias",3,"innerHtml"],[1,"d-flex","justify-content-center","align-items-center"],["routerLink","/menu/Outlets/Master/Park_Layout_Templates/Form","target","_blank",3,"click","queryParams"]],template:function(e,i){if(e&1){let n=v();r(0,"modal-material",1),f("onClose",function(){return u(n),g(i._dialogRef.close())})("onCancel",function(){return u(n),g(i._dialogRef.close())}),r(1,"content",2),_(2,Ta,6,2,"div",3)(3,Ea,5,3,"ng-template",null,0,H),a()()}if(e&2){let n=F(4);c("config",i.modalConfig),s(2),c("ngIf",(i.parkLayoutPack==null||i.parkLayoutPack.Layout==null?null:i.parkLayoutPack.Layout.length)>0)("ngIfElse",n)}},dependencies:[J,fe,U,Z,K,ie,Q,xi,xt,It,vt,Qt,or],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.dialogPicker[_ngcontent-%COMP%]{list-style:none;padding:0 0 6px;display:flex;flex-wrap:wrap!important;margin:0 0 0 20px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%]{min-height:95px;margin-bottom:-6px;width:140px;margin-right:12px;margin-top:15px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #B1AAAA;border-radius:5px;cursor:pointer}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%]:hover, .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.active[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.active[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.vacant[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#89b03e}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] .card-text[_ngcontent-%COMP%] i.fa-chair[_ngcontent-%COMP%]{font-size:2.5rem}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:55px;padding:10px;position:relative}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px;font-size:20px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.dialogPicker[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}"]})};var Zi=class o{constructor(t){this._dialogRef=t;this.modalConfig=new W,this.modalConfig.title="Select Print Type",this.modalConfig.hideFooter=!0}modalConfig;onPrintOrder(){this._dialogRef.close("ORDER")}onPrintBill(){this._dialogRef.close("BILL")}static \u0275fac=function(e){return new(e||o)(m(j))};static \u0275cmp=M({type:o,selectors:[["POS-modal-print"]],standalone:!1,decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg","me-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/order.png"],[1,"mt-1"],[1,"mt-0"],[1,"btn","btn-gray","btn-lg","ms-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/bill.png",2,"width","23px"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),f("click",function(){return i.onPrintOrder()}),b(4,"img",3),r(5,"h4",4),p(6,"Order"),a(),r(7,"div",5),p(8,"For order for the kitchen"),a()(),r(9,"a",6),f("click",function(){return i.onPrintBill()}),b(10,"img",7),r(11,"h4",4),p(12,"Bill"),a(),r(13,"div",5),p(14,"To see amount of the bill"),a(),r(15,"div",5),p(16,"(Pre-settlement bill)"),a()()()()()),e&2&&c("config",i.modalConfig)},dependencies:[Q],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:8px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var en=class o{constructor(t,e,i,n,l,C,R,oe,Ce){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=n;this._orderProcessorService=l;this._orderHttpService=C;this._dialog=R;this._outletRegisterService=oe;this.parkService=Ce;this.salesOrderData=this._orderDataService.Data,this.appConfig=this._posHttpResponseService.Data.AppConfigJSON,this.parkLayoutPack=this._outletRegisterService.Data.ParkLayoutPack}modalConfig=new W;salesOrderData;appConfig;parkLayoutPack;ngOnInit(){this.modalConfig.title="Re-Park Order?",this.modalConfig.hideFooter=!0}onRepark(){this.parkService.park(this.parkOrderRetrieve).subscribe(t=>{this.dialogRef.close()})}onMove(){this.dialogRef.close(),this.showParkSelectModal()}showParkSelectModal(){this._orderHttpService.getVacant(this.salesOrderData.Order.EntityID).subscribe(t=>{this._dialog.open(Zt,{data:{title:this.title,parkLayoutPack:this.parkLayoutPack,qty:this.salesOrderData.TotalQuantity,entityId:this.salesOrderData.Order.EntityID,occupied:t.Orders,replaceWithAlias:this.appConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias}})})}get title(){return this._orderProcessorService.Data.posState==5?"Split Order":this.appConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle}static \u0275fac=function(e){return new(e||o)(m(j),m(Ve),m(N),m(A),m(q),m(he),m(ne),m(Y),m(Se))};static \u0275cmp=M({type:o,selectors:[["POS-modal-repark"]],standalone:!1,decls:13,vars:2,consts:[[3,"onClose","onCancel","title","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg",3,"click"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),f("click",function(){return i.onRepark()}),r(4,"h4"),p(5,"Re-Park"),a(),r(6,"span"),p(7,"Store order to same location"),a()(),r(8,"a",2),f("click",function(){return i.onMove()}),r(9,"h4"),p(10,"Move"),a(),r(11,"span"),p(12,"Shift order to Different location"),a()()()()()),e&2&&c("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[Q],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:25px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var tn=class{_point;get point(){return this._point}set point(t){this._point=t}_pricebookID;get pricebookID(){return this._pricebookID}set pricebookID(t){this._pricebookID=t}_discountRate;get discountRate(){return this._discountRate}set discountRate(t){this._discountRate=t}_groups;get groups(){return this._groups}set groups(t){this._groups=t}_salesID;get salesID(){return this._salesID}set salesID(t){this._salesID=t}_dueDays;get dueDays(){return this._dueDays}set dueDays(t){this._dueDays=t}_expiryDate;get expiryDate(){return this._expiryDate}set expiryDate(t){this._expiryDate=t}_debt;get debt(){return this._debt}set debt(t){this._debt=t}_expirtedString;get expirtedString(){return this._expirtedString}set expirtedString(t){this._expirtedString=t}_loyaltyDisabled;get loyaltyDisabled(){return this._loyaltyDisabled}set loyaltyDisabled(t){this._loyaltyDisabled=t}_taxTypeID;get taxTypeID(){return this._taxTypeID}set taxTypeID(t){this._taxTypeID=t}_entityID;get entityID(){return this._entityID}set entityID(t){this._entityID=t}_mobile;get mobile(){return this._mobile}set mobile(t){this._mobile=t}_email;get email(){return this._email}set email(t){this._email=t}_dueMonths;get dueMonths(){return this._dueMonths}set dueMonths(t){this._dueMonths=t}_memberIdentification;get memberIdentification(){return this._memberIdentification}set memberIdentification(t){this._memberIdentification=t}};var ui=class{OutletName;Status;AmountSummary;Coupon;Creator;CurrencySymbol;Customer;Date;Delivery;ExtraNote;FinalAmount;InvoiceNote;Items;List;LoyaltyPoint;Payments;PrintDate;RegisterCode;SalesOrderItemCommission;Shipping;Title;TypeName;paymentState;ToP;Due;InvoiceID;Gopay;Number;Created;SalesName;ParkLabel;HeaderTitle;QRContent;Retur;AfterSell;constructor(){this.OutletName="",this.Status=1,this.AmountSummary=[],this.Coupon="",this.Creator="",this.CurrencySymbol="",this.Customer=new tn,this.Date="",this.Delivery={Number:""},this.ExtraNote="",this.FinalAmount=0,this.InvoiceNote="",this.Items=[],this.List=[],this.LoyaltyPoint="",this.Payments=[],this.PrintDate="",this.RegisterCode="",this.SalesOrderItemCommission={SalesName:""},this.Shipping=new di,this.Title="",this.TypeName="",this.paymentState=0,this.InvoiceID="",this.Number="",this.Created="",this.AfterSell=!0}};var ti=class{LayoutPack;constructor(t){this.LayoutPack=t,this.GenerateLayoutOption()}GenerateLayoutOption(){this.LayoutPack!=null&&this.LayoutPack.Layout&&this.LayoutPack.Layout.forEach(t=>{t.Options=[];for(let e=1;e<=t.Size;e++){let i=new Xt;i.Name=t.Name+e,i.Alias=this.GetAlias(i.Name),t.Options.push(i)}})}GetAlias(t){if(this.LayoutPack!=null&&this.LayoutPack.Alias){let e=this.LayoutPack.Alias.filter(i=>i.Name==t);return e.length>0?e[0].Alias:t}return""}};var nn=class{ExtraNote;Title;Customer;SalesName;InvoiceNote;Date;Items;AmountSummary;Creator;NumberOfPerson;CurrencySymbol;constructor(){this.ExtraNote="",this.Title="",this.Customer="",this.SalesName="",this.InvoiceNote="",this.Date="",this.Items=[],this.AmountSummary=[],this.Creator="",this.NumberOfPerson=0,this.CurrencySymbol="Rp"}};var on=class{AmountSummary;Contact;ContactDisplay;CurrencySymbol;FinalAmount;HeaderTitle;Invoice;IsPrice;Items;LoyaltyPoint;Order;Payments;PriceVisible;PrintPerson;PrintTime;SalesName;Shipping;TotalInWord};var Dt=class o{constructor(t,e,i,n,l,C,R,oe){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=n;this._OrderHttpService=l;this._receiptCalculatorService=C;this._orderProcessorService=R;this._customerHttpService=oe;this.subscribeToObservableChanges()}posData;completeData;park=new ti(null);outletInfo=new Ni;datePipe=new We("en-US");ParkTemp=Array();CartItems=[];get posStorage(){return this._posService.Data}get AppConfigJSON(){return this._posService.Data.AppConfigJSON}subscribeToObservableChanges(){this._orderDataService.Data$.subscribe(t=>{this.posData=t}),this._OrderHttpService.Data$.subscribe(t=>{this.completeData=t}),this._outletService.Data$.subscribe(t=>{this.outletInfo=t}),this._orderProcessorService.Data$.subscribe(t=>{this.ParkTemp=t.parkTemporaryItem})}generateReceiptMini(){let t=new ui;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this.getSubmitedCustomer(),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.SalesOrderItemCommission={SalesName:this._outletService.getSalesname(this.posData.Order.SalesID)},t.Number=this.completeData?.InvoiceNumber,t.FinalAmount=this.completeData?.Final,t.InvoiceNote=this.posData.Order.Note,t.RegisterCode=this.outletInfo.RegisterCode==null?"":this.outletInfo.RegisterCode,t.QRContent=this.generateQrContent(),t.InvoiceID=this.completeData?.ObjectID,t.Retur=S.IsNotEmpty(this.posData?.Invoice?.ReferenceInvoiceID),t.Date=this.getSubmitedOrderDate(),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),this.posData.CartItems.forEach(i=>{i.SalesID&&(i.SalesName=this._outletService.getSalesname(i.SalesID))}),t.Items=this.posData.CartItems;for(let i=0;i<t.Items.length;i++)t.List.push({Name:t.Items[i].Variant.Name,Quantity:t.Items[i].Quantity,VariantID:t.Items[i].VariantID});t.Customer!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&(t.Customer={ID:this.posData.Order.CustomerID,Display:this.posData.ContactName,Email:t.Customer.Email,CityName:null,Address:t.Customer.Address,Code:t.Customer.Code,Name:t.Customer.Name,Phone:t.Customer.Phone,Mobile:t.Customer.Mobile,NationalIDNumber:t.Customer.NationalIDNumber,Title:t.Customer.Title}),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);if(e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.LoyaltyPoint=this.completeData?this.completeData.LoyaltyPoint:"",t.FinalAmount=this._cashierCalculatorService.Data,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.paymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments.forEach(i=>{i.MethodName=this.findPaymentName(i.MethodID)}),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Creator=this.completeData?.Creator?this.completeData?.Creator:this.posStorage?.UserName,this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoicePaymentTermsVisible&&this.posData.Payments.length==0){let i=this.posData.Invoice.Due?new Date(this.posData.Invoice.Due):null,n=new Date(this.posData.Order.Date);n.setHours(0,0,0,0),t.ToP=this.generateTop(n,i),this.posData.Invoice.Due!==void 0&&(t.Due=this.datePipe.transform(new Date(this.posData.Invoice.Due),"dd MMMM yyyy"))}return t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.TransformTo==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,n=this.posData?.Order?.Number,l=this.completeData.ObjectID,C=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=n;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${C}`)}`;break}}return t}generateShippingData(){return{City:this.posData.Shipping!==null?this.posData.Shipping.City:null,Description:this.posData.Shipping!==null?this.posData.Shipping.Address:null,ID:null,Phone:this.posData.Shipping!==null?this.posData.Shipping.Phone:null,Recipient:this.posData.Shipping!==null?this.posData.Shipping.Name:null,SalesOrderID:null,Sender:null,SenderAddress:null,SenderCity:null,SenderPhone:null,Street:null}}generateParkReceipt(t=!0,e=!1){let i=new nn;if(i.ExtraNote=S.StringFormat("{0} #{1}",this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.NumberPrefix,this.GetSubmittedNumber()),i.Title=this.getParkLabel(),i.Customer=this.getSubmitedCustomer(),i.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),i.InvoiceNote=this.posData.Order.Note,i.Date=this.getSubmitedOrderDate(),i.CurrencySymbol=this._cashierCalculatorService.currencySymbol,this.getItemsParkReceipt(t,e),i.Items=this.CartItems,i.Creator=this.posStorage.UserName,i.NumberOfPerson=this.posData.Order.NumberOfPerson,this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.AmountVisible){let n=JSON.parse(JSON.stringify(this._receiptCalculatorService.generateAmountSummary()));i.AmountSummary=n}return i}getItemsParkReceipt(t,e){let i=tt(Fe,this.posData.CartItems);if(e){let n=this.posData.CartItems.filter(l=>S.IsNotEmpty(l.SplitQuantity)&&l.SplitQuantity>0);this.CartItems=n.map(l=>(l.Quantity=l.SplitQuantity,l))}else if(t&&this.AppConfigJSON.ApplicationParkAndRetrieve.PrintBehaviour.PrintAdditionalItemsOnlyOnRePark)if(this.CartItems=Array(),this.ParkTemp.length>0)for(let n of i){let l=this.ParkTemp.find(C=>C.ID==n.ID);l==null?this.CartItems.push(n):n.Quantity!=l.Quantity&&(n.Quantity=n.Quantity-l.Quantity,this.CartItems.push(n))}else this.CartItems=i;else this.CartItems=i}generateBillInvoice(){let t=new on;return t.ContactDisplay=this.posData.ContactName,t.Invoice=this.posData.Invoice,t.Order=this.posData.Order,t.Payments=this.posData.Payments,t.Shipping=this.posData.Shipping,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Contact=this.getSubmitedCustomer(),t.Items=this.getItemsBillInvoice(),t.PrintTime=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm"),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.Invoice.Number=`#${this.posData.Order.Number}`,t.Invoice.Date=new Date,t.Invoice.PaymentStateID=1,t.Invoice.Note=this.posData.Order.Note,t.PrintPerson="",t.IsPrice=!0,t.PriceVisible=!0,t}getItemsBillInvoice(){return this.posData.CartItems.map(e=>({Name:e.Variant.Name,Quantity:e.Quantity,Code:e.Variant.Code,UnitPrice:e.Price,Discount:e.Discount,UOMName:e.Variant.UOMName,Total:e.Total,Note:e.Note}))}generateBillReceipt(){let t=new ui;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.ParkLabel=this.posData.Order.ParkLabel,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this._customerHttpService.Data,t.SalesOrderItemCommission.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.Number=this.posData.Order.Number,t.FinalAmount=this._cashierCalculatorService.Data,t.InvoiceNote=this.posData.Order.Note,t.Date=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy"),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),t.Items=this.posData.CartItems;for(let i=0;i<t.Items.length;i++)t.List.push({Name:t.Items[i].Variant.Name,Quantity:t.Items[i].Quantity,VariantID:t.Items[i].VariantID});t.Customer.ID=this.posData.Order.CustomerID,t.Customer.Name=this.posData.ContactName,t.Customer.Display=this.posData.ContactName,t.Customer.Mobile&&t.Customer.Mobile.length==1&&(t.Customer.Mobile=null),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);return e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.paymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments=t.Payments.map(i=>(i.MethodName=this.findPaymentName(i.MethodID),i)),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}getPaymentState(){let t=this.AppConfigJSON?.ModuleSell?.ToleranceAmount,e=this.posData.Payments,i=this.posData.TotalPaidAmount,n=this._cashierCalculatorService.Data,l=1;e?.length>0&&i<n&&(l=2);let C=i-n;return(Math.abs(C)<=t||C>=0)&&(l=3),l}generateTop(t,e){let i=new Date(e),n=new Date(t),l=i.getTime()-n.getTime();return Math.floor(l/(1e3*3600*24))}getSubmitedOrderDate(){let t=this.posData.Order?.Date,e=this.AppConfigJSON.PrintConfigInvoice?.DocumentVisibility?.OrderTimeVisible,i="",n=new Date;if(e){let l=new Date(t);l.setHours(n.getHours()),l.setMinutes(n.getMinutes()),i=this.datePipe.transform(l,"dd MMM yyyy HH:mm")}else i=this.datePipe.transform(t,"dd MMM yyyy");return i}getSubmitedCustomer(){return S.IsEmpty(this.completeData)?{}:this.completeData.Contact}getParkLabel(){let t=this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.LabelPrefix,e=this.AppConfigJSON.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,i=this.posData.Order.ParkLabel;if(S.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&S.IsNotEmpty(i)){let n=this.park.GetAlias(i);i=n||i}return i?S.IsEmpty(t)?i:S.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return S.IsNotEmpty(this.completeData)?this.completeData.InvoiceNumber:this.posData.Invoice.Number?this.posData.Invoice.Number:this.posData.Order.Number}generateCartItemSummary(){let t=[];for(let e of this.posData.CartItems)t.push(new Li(e.Total,this._cashierCalculatorService.currencySymbol,e.Variant.Name,1));return t}generatePaymentSummary(){let t=[],e;for(let n=0;n<this.posData.Payments.length;n++){let l="Payment"+(n+1);this.AppConfigJSON.PrintConfigInvoice.Footer.PaymentMethodVisible&&(l=this.findPaymentName(Number(this.posData.Payments[n].MethodID))),e=new Li(this.posData.Payments[n].PaidAmount,this._cashierCalculatorService.currencySymbol,l,1),t.push(e)}let i=this.generateChangeSummary();return i!==null&&t.push(i),t}generateChangeSummary(){let t=this._cashierCalculatorService.currencySymbol,e=this._cashierCalculatorService.Data,i=this.posData.TotalPaidAmount,n=0,l=null;return n=i-e,n>0&&(l=new Li(n,t,"Change",1)),l}findPaymentName(t){return this._outletService.Data.Payments.find(e=>e.ID==t).Name}printWindow(){return go(this,null,function*(){return new Promise(t=>{setTimeout(()=>{window.print(),t()},500)})})}static \u0275fac=function(e){return new(e||o)(L(A),L(N),L(Pe),L(Y),L(he),L(Bi),L(q),L(pt))};static \u0275prov=Je({token:o,factory:o.\u0275fac,providedIn:"root"})};var Se=class o{constructor(t,e,i,n,l,C,R,oe,Ce,dt,ot){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=n;this.salesOrderService=l;this.toastrService=C;this.promotionEventService=R;this.outletService=oe;this.orderHttpService=Ce;this.dialog=dt;this.signalBroadcastService=ot;this._onPrint=new $,this.onPrint$=this._onPrint.asObservable(),this.subscribeToObservable()}_onPrint;onPrint$;parkOrderRetrieve;subscribeToObservable(){this.orderProcessorService.Data$.subscribe(t=>{(t.posState==3||t.posState==5)&&this.emitParkReceipt(!0,t.posState==5)})}getParkedOrder(t,e){return this.httpService.get(ae.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(ae.VoidPark,i):this.httpService.post(ae.RemovePark,i)}mergePark(t){return this.httpService.post(ae.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(ae.GetOutStanding,e)}splitOrder(t){return this.httpService.post(ae.SplitOrder,t)}park(t){let e=tt(ct,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.DeliveryEntityID=S.GuidEmpty,e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,S.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(ae.ParkOrder,i).pipe(Ee(n=>{this.orderProcessorService.updatePosState(3,n),this.orderProcessorService.createNewTransactionInSameOutletRegister()}))}clearPromotionAppliedInPark(){this.dialog.open(br,{id:"modal-promotion-confirm",data:{message:`
1
+ import{a as Yr,b as Zn}from"./chunk-VUQYK4SJ.js";import{b as Gr,c as zr}from"./chunk-4BWXOLIW.js";import{a as Br}from"./chunk-RF47WLGG.js";import{b as Fr,e as jr,f as Hr,g as Ur}from"./chunk-SD7K34RH.js";import{a as ea}from"./chunk-GSLPZSSX.js";import{A as Dr,B as Qi,C as zt,D as qi,E as Rr,F as Nr,G as $i,H as Ar,I as Lr,a as mr,b as ct,c as gr,d as he,e as N,f as A,g as fr,h as me,i as _r,j as Cr,k as Y,l as br,m as hr,n as Pe,o as vr,p as $t,q as Le,r as Jt,s as Ai,t as Li,u as Bi,v as Mt,w as Xn,x as Fi,y as q,z as Mr}from"./chunk-FGPRYCGV.js";import"./chunk-F6GAPEFT.js";import"./chunk-TK5H65DN.js";import"./chunk-6L6CIH5M.js";import"./chunk-JENBDDPJ.js";import{a as Zr}from"./chunk-CVTOBG53.js";import{a as $r,b as Jr}from"./chunk-YUFPB7RC.js";import{a as Or,b as xr,c as Ir,d as Hi}from"./chunk-U37IA35U.js";import{b as Xr}from"./chunk-35EIBQSG.js";import{a as dr}from"./chunk-HBNFET4C.js";import"./chunk-DHEQAB6U.js";import{b as Fe}from"./chunk-QNZDTLBV.js";import"./chunk-2IT6TVBI.js";import{a as wi}from"./chunk-VRV3OFCZ.js";import{a as Kr,b as Ki}from"./chunk-F56RRQ2D.js";import{a as wr,b as kr}from"./chunk-MSKXTGJV.js";import{c as Ui,d as Wi}from"./chunk-MBZ4X6KE.js";import"./chunk-E42HYMH5.js";import"./chunk-CWUYG4I7.js";import{a as Zo}from"./chunk-4TJP3I23.js";import{a as zi}from"./chunk-QJO2HEHQ.js";import"./chunk-RQPXOFKZ.js";import{a as Ae,b as pt}from"./chunk-EHAWYQX6.js";import"./chunk-SFH4OHUD.js";import{a as qr}from"./chunk-DQ6MBFAC.js";import{a as Gi}from"./chunk-XW55YDWI.js";import"./chunk-YGQY3ZO6.js";import"./chunk-SE7OFLAL.js";import"./chunk-73GZUVTA.js";import"./chunk-WLRXTHLM.js";import{a as ur,b as Tr,c as Er}from"./chunk-ARXCUZB7.js";import{a as Vi}from"./chunk-RGXISNHE.js";import{a as Vr}from"./chunk-LVPVFHNY.js";import"./chunk-OBQ3N46V.js";import"./chunk-KHIVRNUW.js";import"./chunk-D7J7QKYR.js";import"./chunk-6CWHLMOD.js";import"./chunk-ICTX5LEL.js";import{d as cr,e as pr}from"./chunk-LPG2RJLT.js";import"./chunk-F56IKJ5L.js";import"./chunk-3RK6DDJD.js";import"./chunk-I5GQBAR7.js";import"./chunk-BYXBJQAS.js";import{a as mi}from"./chunk-RO76NHEN.js";import{a as be,c as Ni}from"./chunk-J2H55XWI.js";import{a as Yn}from"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import{c as di}from"./chunk-NHG7IM7O.js";import{a as ki}from"./chunk-I4MJUIXL.js";import{a as Ei,b as Ri}from"./chunk-ILOSUGZZ.js";import{a as Ji,b as Wr,c as Qr}from"./chunk-42BW7I7K.js";import"./chunk-OSZRROV7.js";import{a as Kn}from"./chunk-BGTI5KGX.js";import{a as yr,b as ji}from"./chunk-7UE6XABD.js";import{a as Gt,b as Sr}from"./chunk-3MNL3EI2.js";import"./chunk-GO2SAICT.js";import"./chunk-GV52FU6D.js";import"./chunk-F6236QM2.js";import{b as xi,c as xt,d as It,e as Ii}from"./chunk-HN6WDNY2.js";import"./chunk-S7ZNAMPJ.js";import{a as Pr}from"./chunk-KS3WKPHQ.js";import"./chunk-DWSWGVFO.js";import{b as Ti,c as tt}from"./chunk-HT35KHLT.js";import"./chunk-BYXBJQAS.js";import"./chunk-Y6QUFAXA.js";import{d as Mi,e as Di}from"./chunk-7Y2JH7DD.js";import{a as $o,b as Jo,c as Go}from"./chunk-B3BT3A2V.js";import"./chunk-R4BNPX7T.js";import"./chunk-PECLRH37.js";import"./chunk-UBVLAOUK.js";import"./chunk-EBC6YN66.js";import"./chunk-375PELC6.js";import{a as er}from"./chunk-CZDMIN7T.js";import"./chunk-NXF2KNQV.js";import{a as zo,d as Ko,f as Yo}from"./chunk-UWAYE735.js";import{a as ut,b as st}from"./chunk-M3ZVAEY4.js";import{a as sr}from"./chunk-VHPR3WDH.js";import{a as Xo,b as tr}from"./chunk-2SYD5HCW.js";import"./chunk-RZN6NBPT.js";import{a as Uo}from"./chunk-CJJZJDMF.js";import{C as W,D as Q,E as Qe,K as lr,L as Ie,N as qt,O as Pt,u as j,v as Ve,w as ne}from"./chunk-DG336IKR.js";import{M as Wo,Z as Qo,_ as qo,ga as de,ha as Ke}from"./chunk-ZK4PRXMK.js";import{G as ar,O as Pi,P as ae,a as ir,b as nr,n as Qt,v as or,y as rr}from"./chunk-OTTXNYU5.js";import{a as Ro}from"./chunk-BSKYOCR4.js";import"./chunk-GIKR6Y2K.js";import{c as et}from"./chunk-IAFFKB7Q.js";import{a as Ho}from"./chunk-LAO3WZ2T.js";import"./chunk-DHDHZ4XD.js";import"./chunk-KAD4FFMP.js";import{a as Be}from"./chunk-2FWFPV5I.js";import"./chunk-XQ7RY4AB.js";import{B as Fo,D as xe,E as ze,a as No,b as St,c as Z,d as Vo,e as pi,g as Ao,h as K,j as Lo,l as yt,m as Bo,o as ie,r as Oi,s as Ot,y as Ht}from"./chunk-L57WBNZV.js";import{a as jt,c as Wt}from"./chunk-NZW336DF.js";import{a as jo}from"./chunk-VUEBPQ7B.js";import{a as S,d as Ut}from"./chunk-4CRH5QZU.js";import"./chunk-AIN6SDES.js";import{a as Ne}from"./chunk-D2UWUEGL.js";import{$ as Oe,$c as Re,Aa as vo,Cb as B,Cc as H,E as se,Ea as He,Hb as r,Hc as Po,I as ai,Ia as hi,Ib as a,Ja as So,Jb as b,Kb as O,Kd as To,L as Co,La as ce,Lb as x,Mb as si,Md as Eo,Nb as v,Od as ht,Pb as f,Pc as Mo,Pd as vt,Qb as d,Rd as Ft,Tb as ci,Tc as J,Td as z,Ua as Bt,Ub as xo,Va as Ye,Vc as fe,Wc as U,X as Lt,Ya as Xe,Yb as De,Zb as we,Zc as Do,_a as s,_b as ke,_c as yi,bd as We,c as fo,ca as P,cb as m,cc as F,d as $,dc as p,dd as X,e as $n,ea as Ee,ec as T,fc as y,fd as wo,gc as Ue,gd as te,ha as bo,ia as Je,ic as D,ja as Ct,jb as M,jc as w,jd as ko,k as _o,kb as bt,kc as k,la as L,lb as vi,ma as pe,mc as at,nb as Si,nc as lt,o as Jn,oc as E,pb as _,pc as ye,qc as Io,t as rt,ta as ho,tb as yo,u as At,ua as u,ub as c,va as g,vb as Gn,wb as li,wc as h,xb as Oo,xc as I,yb as Ze,yc as re,zb as zn,zc as Ge}from"./chunk-2PTKV6NN.js";import{j as go}from"./chunk-7DCB7DB2.js";var Yi=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var Kt=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var Yt=class o{constructor(t,e,i,n,l,C){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=n;this.parkService=l;this.data=C;this.initModalDialog(),this.initConfig(),this.parkLabel=C.ParkLabel,this.form.ParkLabel=C.ParkLabel,this.form.Note=n.Data.Order.Note}modalConfig=new W;labelPlaceholder;form=new Kt;parkLabel;initConfig(){let t=this._posService.Data.AppConfigJSON;this.labelPlaceholder=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder}initModalDialog(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="600px"}onOk(){this.setParkTitle(),this.parkService.park(this.form).subscribe(t=>{this.dialogRef.close(!0)})}setParkTitle(){let t=this._orderProcessorService.Data.posState,e=this.salesOrderService.Data.Order.Number;t==5?this.salesOrderService.Data.SplitParkLabel=S.IsEmpty(this.parkLabel)?e:this.parkLabel:S.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||o)(m(j),m(q),m(A),m(N),m(Se),m(Ve))};static \u0275cmp=M({type:o,selectors:[["POS-modal-park-input"]],standalone:!1,decls:10,vars:4,consts:[[3,"onCancel","onOk","onClose","config"],[1,"w-100"],[1,"mb-3"],["type","text","required","","matTooltip","Same as Order Number when blank",1,"form-control","w-100","height-input",3,"ngModelChange","ngModel","placeholder"],[1,"w-100","mt-4"],["placeholder","ex: Customer will return tommorow",3,"valueChange","value"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("onCancel",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()})("onClose",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"strong",2),p(4,"Label"),a(),r(5,"input",3),k("ngModelChange",function(l){return w(i.parkLabel,l)||(i.parkLabel=l),l}),a()(),r(6,"div",4)(7,"strong",2),p(8,"Note"),a(),r(9,"POS-tinymce-editor",5),k("valueChange",function(l){return w(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(c("config",i.modalConfig),s(5),D("ngModel",i.parkLabel),c("placeholder",i.labelPlaceholder?i.labelPlaceholder:"Insert Initial for the order"),s(4),D("value",i.form.Note))},dependencies:[Z,K,Ht,ie,Q,de,Gt],styles:[".height-input[_ngcontent-%COMP%]{height:36px} ng-select.park-detail>div.ng-select-container{border-radius:0!important}.deposit[_ngcontent-%COMP%] .ng-select{width:auto!important}.ods-info-box[_ngcontent-%COMP%]{background-color:#e8f4fd;border-left:4px solid #0dcaf0;padding:16px 20px;border-radius:8px;font-family:Roboto Slab,sans-serif;color:#055160;display:flex;align-items:flex-start;gap:10px;font-size:14px;max-width:600px;margin:0 auto}"]})};var Xt=class{Name;Alias;IsOccupied};var xa=(o,t)=>({"text-danger":o,"text-success":t}),Ia=o=>({ID:o});function Pa(o,t){if(o&1&&(r(0,"span"),p(1),h(2,"limitTo"),a()),o&2){let e=d().$implicit,i=d(3);s(),T(i.parkLayoutPack.Layout.length<5?e.Name:re(2,1,e.Name,5))}}function Ma(o,t){if(o&1&&b(0,"span",23),o&2){let e=d().$implicit;c("innerHtml",e.Alias,Bt)}}function Da(o,t){if(o&1){let e=v();r(0,"div",14)(1,"div",15),f("click",function(){let n=u(e).$implicit,l=d(4);return g(l.onSelect(n))}),r(2,"div",16)(3,"h6",17),b(4,"i",18),p(5),h(6,"limitTo"),a(),r(7,"div",19)(8,"span",20),b(9,"i",21),a(),_(10,Ma,1,1,"span",22),a()()()()}if(o&2){let e=t.$implicit,i=d(4);s(),c("title",e.Name),s(),c("ngClass",i.getStatus(e.Name)),s(3),y(" ",re(6,5,e.Alias?e.Alias:e.Name,15)," "),s(3),c("ngClass",ye(8,xa,i.getNote(e.Name)=="OCCUPIED",i.getNote(e.Name)!="OCCUPIED")),s(2),c("ngIf",e.Alias&&!i.replaceWithAlias)}}function wa(o,t){if(o&1&&(r(0,"mat-tab"),_(1,Pa,3,4,"ng-template",10),r(2,"div",11)(3,"div",12),_(4,Da,11,11,"div",13),h(5,"Filter"),a()()()),o&2){let e=t.$implicit,i=d(3);s(4),c("ngForOf",Ge(5,1,e.Options,i.filter,"Name"))}}function ka(o,t){if(o&1&&(r(0,"mat-tab-group"),_(1,wa,6,5,"mat-tab",9),a()),o&2){let e=d(2);s(),c("ngForOf",e.parkLayoutPack.Layout)}}function Ta(o,t){if(o&1){let e=v();r(0,"div")(1,"div",4)(2,"span",5),b(3,"i",6),a(),r(4,"input",7),k("ngModelChange",function(n){u(e);let l=d();return w(l.filter,n)||(l.filter=n),g(n)}),a()(),_(5,ka,2,1,"mat-tab-group",8),a()}if(o&2){let e=d();s(4),D("ngModel",e.filter),s(),c("ngIf",e.parkLayoutPack.Layout)}}function Ea(o,t){if(o&1){let e=v();r(0,"div",24)(1,"h4"),p(2,"Please write Layout column inside Park Layout Template, "),r(3,"a",25),f("click",function(){u(e);let n=d();return g(n._dialogRef.close())}),p(4,"click here to setup the park layout"),a()()()}if(o&2){let e=d();s(3),c("queryParams",E(1,Ia,e.parkLayoutPack.ID))}}var Zt=class o{constructor(t,e,i,n,l,C,R,oe,Ce,dt,ot){this._dialogRef=t;this.data=e;this._orderHttpService=i;this._orderDataService=n;this._localData=l;this._posService=C;this._orderProcessorService=R;this._dialog=oe;this._toastr=Ce;this._outletService=dt;this.parkService=ot;this.parkLayoutPack=e.parkLayoutPack,this.qty=e.qty,this.replaceWithAlias=e.replaceWithAlias,this.entityId=e.entityId,this.occupied=e.occupied,this.totalOption=0,this.appConfigJson=this._posService.Data.AppConfigJSON,this.salesOrderData=this._orderDataService.Data,this.payments=this._outletService.Data.Payments,this.parkLayoutPack.Layout.forEach(je=>{this.totalOption+=je.Size,je.Options=[];for(let mt=1;mt<=je.Size;mt++){let _t=new Xt;_t.Name=je.Name+mt,_t.Alias=this.GetAlias(_t.Name),je.Options.push(_t)}})}modalConfig=new W;title;parkLayoutPack;entityId;occupied;houseKeeping;replaceWithAlias;filter;totalOption;qty;appConfigJson;salesOrderData;payments=[];ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="850px",this.modalConfig.hideFooter=!0,this.modalConfig.bodyScrollable=!0}GetAlias(t){if(this.parkLayoutPack.Alias){let e=this.parkLayoutPack.Alias.filter(i=>i.Name==t);if(e.length>0)return e[0].Alias}return""}onSelect(t){this.getStatus(t.Name)=="vacant"?this.submitToServer(t.Name):this._toastr.warning("Please choose another slot!",`${t.Name} - Occupied`)}submitToServer(t){if(this.appConfigJson.ApplicationParkAndRetrieve.NumberOfPerson||this.appConfigJson.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableNotes)this.openParkFormModal(t);else{let e=new Kt;e.ParkLabel=t,this._dialogRef.close(!0),this.parkService.park(e).subscribe(i=>{this._dialogRef.close(!0)})}}openParkFormModal(t){this._dialog.open(Yt,{data:{title:t,labelDisable:S.IsNotEmpty(this.parkLayoutPack.ID)||this._orderProcessorService.Data.posState==5,labelPlaceholder:this.appConfigJson.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder,listPayment:this.payments,ParkLabel:t||this.salesOrderData.Order.ParkLabel,note:this.salesOrderData.Order.Note,noteEnabled:this.appConfigJson.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableNotes,numberOfPerson:this.salesOrderData.Order.NumberOfPerson,numberOfPersonEnabled:this.appConfigJson.ApplicationParkAndRetrieve.NumberOfPerson},id:"park-form-modal"}).afterClosed().subscribe(e=>{e&&this._dialogRef.close(!0)})}getNote(t){let e=this.getStatus(t);return e=="preparing"?this.houseKeeping.filter(n=>n.Option==t)[0].Notes:e.toUpperCase()}getStatus(t){return this.occupied&&this.occupied.filter(i=>i.ParkLabel==t).length>0?"occupied":this.houseKeeping&&this.houseKeeping.filter(i=>i.Option==t).length>0?"preparing":"vacant"}static \u0275fac=function(e){return new(e||o)(m(j),m(Ve),m(he),m(N),m(Ie),m(A),m(q),m(ne),m(z),m(Y),m(Se))};static \u0275cmp=M({type:o,selectors:[["POS-modal-park-select"]],standalone:!1,decls:5,vars:3,consts:[["BLANK",""],[3,"onClose","onCancel","config"],[1,"park"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3",2,"width","200px"],[1,"input-group-text","txtFilter","pe-0"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0",3,"ngModelChange","ngModel"],[4,"ngIf"],[4,"ngFor","ngForOf"],["mat-tab-label",""],[1,"container","px-0"],[1,"row","dialogPicker"],["class","col-auto px-0",4,"ngFor","ngForOf"],[1,"col-auto","px-0"],[1,"card","mb-0",2,"width","135px",3,"click","title"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0","p-5","text-white","rounded","d-flex",2,"width","132px"],["aria-hidden","true",1,"fa","fa-circle-info","pe-3","mt-1"],[1,"card-text","text-center",2,"width","135px"],[1,"pt-4",3,"ngClass"],[1,"fa-solid","fa-chair"],["class","alias",3,"innerHtml",4,"ngIf"],[1,"alias",3,"innerHtml"],[1,"d-flex","justify-content-center","align-items-center"],["routerLink","/menu/Outlets/Master/Park_Layout_Templates/Form","target","_blank",3,"click","queryParams"]],template:function(e,i){if(e&1){let n=v();r(0,"modal-material",1),f("onClose",function(){return u(n),g(i._dialogRef.close())})("onCancel",function(){return u(n),g(i._dialogRef.close())}),r(1,"content",2),_(2,Ta,6,2,"div",3)(3,Ea,5,3,"ng-template",null,0,H),a()()}if(e&2){let n=F(4);c("config",i.modalConfig),s(2),c("ngIf",(i.parkLayoutPack==null||i.parkLayoutPack.Layout==null?null:i.parkLayoutPack.Layout.length)>0)("ngIfElse",n)}},dependencies:[J,fe,U,Z,K,ie,Q,xi,xt,It,vt,Qt,or],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.dialogPicker[_ngcontent-%COMP%]{list-style:none;padding:0 0 6px;display:flex;flex-wrap:wrap!important;margin:0 0 0 20px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%]{min-height:95px;margin-bottom:-6px;width:140px;margin-right:12px;margin-top:15px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #B1AAAA;border-radius:5px;cursor:pointer}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%]:hover, .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.active[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.active[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.vacant[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#89b03e}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] .card-text[_ngcontent-%COMP%] i.fa-chair[_ngcontent-%COMP%]{font-size:2.5rem}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:55px;padding:10px;position:relative}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px;font-size:20px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] div.card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.dialogPicker[_ngcontent-%COMP%] div.col-auto[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.dialogPicker[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}"]})};var Zi=class o{constructor(t){this._dialogRef=t;this.modalConfig=new W,this.modalConfig.title="Select Print Type",this.modalConfig.hideFooter=!0}modalConfig;onPrintOrder(){this._dialogRef.close("ORDER")}onPrintBill(){this._dialogRef.close("BILL")}static \u0275fac=function(e){return new(e||o)(m(j))};static \u0275cmp=M({type:o,selectors:[["POS-modal-print"]],standalone:!1,decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg","me-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/order.png"],[1,"mt-1"],[1,"mt-0"],[1,"btn","btn-gray","btn-lg","ms-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/bill.png",2,"width","23px"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),f("click",function(){return i.onPrintOrder()}),b(4,"img",3),r(5,"h4",4),p(6,"Order"),a(),r(7,"div",5),p(8,"For order for the kitchen"),a()(),r(9,"a",6),f("click",function(){return i.onPrintBill()}),b(10,"img",7),r(11,"h4",4),p(12,"Bill"),a(),r(13,"div",5),p(14,"To see amount of the bill"),a(),r(15,"div",5),p(16,"(Pre-settlement bill)"),a()()()()()),e&2&&c("config",i.modalConfig)},dependencies:[Q],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:8px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var en=class o{constructor(t,e,i,n,l,C,R,oe,Ce){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=n;this._orderProcessorService=l;this._orderHttpService=C;this._dialog=R;this._outletRegisterService=oe;this.parkService=Ce;this.salesOrderData=this._orderDataService.Data,this.appConfig=this._posHttpResponseService.Data.AppConfigJSON,this.parkLayoutPack=this._outletRegisterService.Data.ParkLayoutPack}modalConfig=new W;salesOrderData;appConfig;parkLayoutPack;ngOnInit(){this.modalConfig.title="Re-Park Order?",this.modalConfig.hideFooter=!0}onRepark(){this.parkService.park(this.parkOrderRetrieve).subscribe(t=>{this.dialogRef.close()})}onMove(){this.dialogRef.close(),this.showParkSelectModal()}showParkSelectModal(){this._orderHttpService.getVacant(this.salesOrderData.Order.EntityID).subscribe(t=>{this._dialog.open(Zt,{data:{title:this.title,parkLayoutPack:this.parkLayoutPack,qty:this.salesOrderData.TotalQuantity,entityId:this.salesOrderData.Order.EntityID,occupied:t.Orders,replaceWithAlias:this.appConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias}})})}get title(){return this._orderProcessorService.Data.posState==5?"Split Order":this.appConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle}static \u0275fac=function(e){return new(e||o)(m(j),m(Ve),m(N),m(A),m(q),m(he),m(ne),m(Y),m(Se))};static \u0275cmp=M({type:o,selectors:[["POS-modal-repark"]],standalone:!1,decls:13,vars:2,consts:[[3,"onClose","onCancel","title","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg",3,"click"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),f("click",function(){return i.onRepark()}),r(4,"h4"),p(5,"Re-Park"),a(),r(6,"span"),p(7,"Store order to same location"),a()(),r(8,"a",2),f("click",function(){return i.onMove()}),r(9,"h4"),p(10,"Move"),a(),r(11,"span"),p(12,"Shift order to Different location"),a()()()()()),e&2&&c("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[Q],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:25px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var tn=class{_point;get point(){return this._point}set point(t){this._point=t}_pricebookID;get pricebookID(){return this._pricebookID}set pricebookID(t){this._pricebookID=t}_discountRate;get discountRate(){return this._discountRate}set discountRate(t){this._discountRate=t}_groups;get groups(){return this._groups}set groups(t){this._groups=t}_salesID;get salesID(){return this._salesID}set salesID(t){this._salesID=t}_dueDays;get dueDays(){return this._dueDays}set dueDays(t){this._dueDays=t}_expiryDate;get expiryDate(){return this._expiryDate}set expiryDate(t){this._expiryDate=t}_debt;get debt(){return this._debt}set debt(t){this._debt=t}_expirtedString;get expirtedString(){return this._expirtedString}set expirtedString(t){this._expirtedString=t}_loyaltyDisabled;get loyaltyDisabled(){return this._loyaltyDisabled}set loyaltyDisabled(t){this._loyaltyDisabled=t}_taxTypeID;get taxTypeID(){return this._taxTypeID}set taxTypeID(t){this._taxTypeID=t}_entityID;get entityID(){return this._entityID}set entityID(t){this._entityID=t}_mobile;get mobile(){return this._mobile}set mobile(t){this._mobile=t}_email;get email(){return this._email}set email(t){this._email=t}_dueMonths;get dueMonths(){return this._dueMonths}set dueMonths(t){this._dueMonths=t}_memberIdentification;get memberIdentification(){return this._memberIdentification}set memberIdentification(t){this._memberIdentification=t}};var ui=class{OutletName;Status;AmountSummary;Coupon;Creator;CurrencySymbol;Customer;Date;Delivery;ExtraNote;FinalAmount;InvoiceNote;Items;List;LoyaltyPoint;Payments;PrintDate;RegisterCode;SalesOrderItemCommission;Shipping;Title;TypeName;paymentState;ToP;Due;InvoiceID;Gopay;Number;Created;SalesName;ParkLabel;HeaderTitle;QRContent;Retur;AfterSell;constructor(){this.OutletName="",this.Status=1,this.AmountSummary=[],this.Coupon="",this.Creator="",this.CurrencySymbol="",this.Customer=new tn,this.Date="",this.Delivery={Number:""},this.ExtraNote="",this.FinalAmount=0,this.InvoiceNote="",this.Items=[],this.List=[],this.LoyaltyPoint="",this.Payments=[],this.PrintDate="",this.RegisterCode="",this.SalesOrderItemCommission={SalesName:""},this.Shipping=new di,this.Title="",this.TypeName="",this.paymentState=0,this.InvoiceID="",this.Number="",this.Created="",this.AfterSell=!0}};var ti=class{LayoutPack;constructor(t){this.LayoutPack=t,this.GenerateLayoutOption()}GenerateLayoutOption(){this.LayoutPack!=null&&this.LayoutPack.Layout&&this.LayoutPack.Layout.forEach(t=>{t.Options=[];for(let e=1;e<=t.Size;e++){let i=new Xt;i.Name=t.Name+e,i.Alias=this.GetAlias(i.Name),t.Options.push(i)}})}GetAlias(t){if(this.LayoutPack!=null&&this.LayoutPack.Alias){let e=this.LayoutPack.Alias.filter(i=>i.Name==t);return e.length>0?e[0].Alias:t}return""}};var nn=class{ExtraNote;Title;Customer;SalesName;InvoiceNote;Date;Items;AmountSummary;Creator;NumberOfPerson;CurrencySymbol;constructor(){this.ExtraNote="",this.Title="",this.Customer="",this.SalesName="",this.InvoiceNote="",this.Date="",this.Items=[],this.AmountSummary=[],this.Creator="",this.NumberOfPerson=0,this.CurrencySymbol="Rp"}};var on=class{AmountSummary;Contact;ContactDisplay;CurrencySymbol;FinalAmount;HeaderTitle;Invoice;IsPrice;Items;LoyaltyPoint;Order;Payments;PriceVisible;PrintPerson;PrintTime;SalesName;Shipping;TotalInWord};var Dt=class o{constructor(t,e,i,n,l,C,R,oe){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=n;this._OrderHttpService=l;this._receiptCalculatorService=C;this._orderProcessorService=R;this._customerHttpService=oe;this.subscribeToObservableChanges()}posData;completeData;park=new ti(null);outletInfo=new Ni;datePipe=new We("en-US");ParkTemp=Array();CartItems=[];get posStorage(){return this._posService.Data}get AppConfigJSON(){return this._posService.Data.AppConfigJSON}subscribeToObservableChanges(){this._orderDataService.Data$.subscribe(t=>{this.posData=t}),this._OrderHttpService.Data$.subscribe(t=>{this.completeData=t}),this._outletService.Data$.subscribe(t=>{this.outletInfo=t}),this._orderProcessorService.Data$.subscribe(t=>{this.ParkTemp=t.parkTemporaryItem})}generateReceiptMini(){let t=new ui;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this.getSubmitedCustomer(),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.SalesOrderItemCommission={SalesName:this._outletService.getSalesname(this.posData.Order.SalesID)},t.Number=this.completeData?.InvoiceNumber,t.FinalAmount=this.completeData?.Final,t.InvoiceNote=this.posData.Order.Note,t.RegisterCode=this.outletInfo.RegisterCode==null?"":this.outletInfo.RegisterCode,t.QRContent=this.generateQrContent(),t.InvoiceID=this.completeData?.ObjectID,t.Retur=S.IsNotEmpty(this.posData?.Invoice?.ReferenceInvoiceID),t.Date=this.getSubmitedOrderDate(),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),this.posData.CartItems.forEach(i=>{i.SalesID&&(i.SalesName=this._outletService.getSalesname(i.SalesID))}),t.Items=this.posData.CartItems;for(let i=0;i<t.Items.length;i++)t.List.push({Name:t.Items[i].Variant.Name,Quantity:t.Items[i].Quantity,VariantID:t.Items[i].VariantID});t.Customer!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&(t.Customer={ID:this.posData.Order.CustomerID,Display:this.posData.ContactName,Email:t.Customer.Email,CityName:null,Address:t.Customer.Address,Code:t.Customer.Code,Name:t.Customer.Name,Phone:t.Customer.Phone,Mobile:t.Customer.Mobile,NationalIDNumber:t.Customer.NationalIDNumber,Title:t.Customer.Title}),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);if(e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.LoyaltyPoint=this.completeData?this.completeData.LoyaltyPoint:"",t.FinalAmount=this._cashierCalculatorService.Data,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.paymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments.forEach(i=>{i.MethodName=this.findPaymentName(i.MethodID)}),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Creator=this.completeData?.Creator?this.completeData?.Creator:this.posStorage?.UserName,this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoicePaymentTermsVisible&&this.posData.Payments.length==0){let i=this.posData.Invoice.Due?new Date(this.posData.Invoice.Due):null,n=new Date(this.posData.Order.Date);n.setHours(0,0,0,0),t.ToP=this.generateTop(n,i),this.posData.Invoice.Due!==void 0&&(t.Due=this.datePipe.transform(new Date(this.posData.Invoice.Due),"dd MMMM yyyy"))}return t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.TransformTo==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,n=this.posData?.Order?.Number,l=this.completeData.ObjectID,C=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=n;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${C}`)}`;break}}return t}generateShippingData(){return{City:this.posData.Shipping!==null?this.posData.Shipping.City:null,Description:this.posData.Shipping!==null?this.posData.Shipping.Address:null,ID:null,Phone:this.posData.Shipping!==null?this.posData.Shipping.Phone:null,Recipient:this.posData.Shipping!==null?this.posData.Shipping.Name:null,SalesOrderID:null,Sender:null,SenderAddress:null,SenderCity:null,SenderPhone:null,Street:null}}generateParkReceipt(t=!0,e=!1){let i=new nn;if(i.ExtraNote=S.StringFormat("{0} #{1}",this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.NumberPrefix,this.GetSubmittedNumber()),i.Title=this.getParkLabel(),i.Customer=this.getSubmitedCustomer(),i.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),i.InvoiceNote=this.posData.Order.Note,i.Date=this.getSubmitedOrderDate(),i.CurrencySymbol=this._cashierCalculatorService.currencySymbol,this.getItemsParkReceipt(t,e),i.Items=this.CartItems,i.Creator=this.posStorage.UserName,i.NumberOfPerson=this.posData.Order.NumberOfPerson,this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.AmountVisible){let n=JSON.parse(JSON.stringify(this._receiptCalculatorService.generateAmountSummary()));i.AmountSummary=n}return i}getItemsParkReceipt(t,e){let i=tt(Fe,this.posData.CartItems);if(e){let n=this.posData.CartItems.filter(l=>S.IsNotEmpty(l.SplitQuantity)&&l.SplitQuantity>0);this.CartItems=n.map(l=>(l.Quantity=l.SplitQuantity,l))}else if(t&&this.AppConfigJSON.ApplicationParkAndRetrieve.PrintBehaviour.PrintAdditionalItemsOnlyOnRePark)if(this.CartItems=Array(),this.ParkTemp.length>0)for(let n of i){let l=this.ParkTemp.find(C=>C.ID==n.ID);l==null?this.CartItems.push(n):n.Quantity!=l.Quantity&&(n.Quantity=n.Quantity-l.Quantity,this.CartItems.push(n))}else this.CartItems=i;else this.CartItems=i}generateBillInvoice(){let t=new on;return t.ContactDisplay=this.posData.ContactName,t.Invoice=this.posData.Invoice,t.Order=this.posData.Order,t.Payments=this.posData.Payments,t.Shipping=this.posData.Shipping,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Contact=this.getSubmitedCustomer(),t.Items=this.getItemsBillInvoice(),t.PrintTime=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm"),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.Invoice.Number=`#${this.posData.Order.Number}`,t.Invoice.Date=new Date,t.Invoice.PaymentStateID=1,t.Invoice.Note=this.posData.Order.Note,t.PrintPerson="",t.IsPrice=!0,t.PriceVisible=!0,t}getItemsBillInvoice(){return this.posData.CartItems.map(e=>({Name:e.Variant.Name,Quantity:e.Quantity,Code:e.Variant.Code,UnitPrice:e.Price,Discount:e.Discount,UOMName:e.Variant.UOMName,Total:e.Total,Note:e.Note}))}generateBillReceipt(){let t=new ui;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.ParkLabel=this.posData.Order.ParkLabel,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this._customerHttpService.Data,t.SalesOrderItemCommission.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.Number=this.posData.Order.Number,t.FinalAmount=this._cashierCalculatorService.Data,t.InvoiceNote=this.posData.Order.Note,t.Date=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy"),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),t.Items=this.posData.CartItems;for(let i=0;i<t.Items.length;i++)t.List.push({Name:t.Items[i].Variant.Name,Quantity:t.Items[i].Quantity,VariantID:t.Items[i].VariantID});t.Customer.ID=this.posData.Order.CustomerID,t.Customer.Name=this.posData.ContactName,t.Customer.Display=this.posData.ContactName,t.Customer.Mobile&&t.Customer.Mobile.length==1&&(t.Customer.Mobile=null),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);return e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.paymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments=t.Payments.map(i=>(i.MethodName=this.findPaymentName(i.MethodID),i)),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}getPaymentState(){let t=this.AppConfigJSON?.ModuleSell?.ToleranceAmount,e=this.posData.Payments,i=this.posData.TotalPaidAmount,n=this._cashierCalculatorService.Data,l=1;e?.length>0&&i<n&&(l=2);let C=i-n;return(Math.abs(C)<=t||C>=0)&&(l=3),l}generateTop(t,e){let i=new Date(e),n=new Date(t),l=i.getTime()-n.getTime();return Math.floor(l/(1e3*3600*24))}getSubmitedOrderDate(){let t=this.posData.Order?.Date,e=this.AppConfigJSON.PrintConfigInvoice?.DocumentVisibility?.OrderTimeVisible,i="",n=new Date;if(e){let l=new Date(t);l.setHours(n.getHours()),l.setMinutes(n.getMinutes()),i=this.datePipe.transform(l,"dd MMM yyyy HH:mm")}else i=this.datePipe.transform(t,"dd MMM yyyy");return i}getSubmitedCustomer(){return S.IsEmpty(this.completeData)?{}:this.completeData.Contact}getParkLabel(){let t=this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.LabelPrefix,e=this.AppConfigJSON.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,i=this.posData.Order.ParkLabel;if(S.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&S.IsNotEmpty(i)){let n=this.park.GetAlias(i);i=n||i}return i?S.IsEmpty(t)?i:S.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return S.IsNotEmpty(this.completeData)?this.completeData.InvoiceNumber:this.posData.Invoice.Number?this.posData.Invoice.Number:this.posData.Order.Number}generateCartItemSummary(){let t=[];for(let e of this.posData.CartItems)t.push(new Li(e.Total,this._cashierCalculatorService.currencySymbol,e.Variant.Name,1));return t}generatePaymentSummary(){let t=[],e;for(let n=0;n<this.posData.Payments.length;n++){let l="Payment"+(n+1);this.AppConfigJSON.PrintConfigInvoice.Footer.PaymentMethodVisible&&(l=this.findPaymentName(Number(this.posData.Payments[n].MethodID))),e=new Li(this.posData.Payments[n].PaidAmount,this._cashierCalculatorService.currencySymbol,l,1),t.push(e)}let i=this.generateChangeSummary();return i!==null&&t.push(i),t}generateChangeSummary(){let t=this._cashierCalculatorService.currencySymbol,e=this._cashierCalculatorService.Data,i=this.posData.TotalPaidAmount,n=0,l=null;return n=i-e,n>0&&(l=new Li(n,t,"Change",1)),l}findPaymentName(t){return this._outletService.Data.Payments.find(e=>e.ID==t).Name}printWindow(){return go(this,null,function*(){return new Promise(t=>{setTimeout(()=>{window.print(),t()},500)})})}static \u0275fac=function(e){return new(e||o)(L(A),L(N),L(Pe),L(Y),L(he),L(Bi),L(q),L(pt))};static \u0275prov=Je({token:o,factory:o.\u0275fac,providedIn:"root"})};var Se=class o{constructor(t,e,i,n,l,C,R,oe,Ce,dt,ot){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=n;this.salesOrderService=l;this.toastrService=C;this.promotionEventService=R;this.outletService=oe;this.orderHttpService=Ce;this.dialog=dt;this.signalBroadcastService=ot;this._onPrint=new $,this.onPrint$=this._onPrint.asObservable(),this.subscribeToObservable()}_onPrint;onPrint$;parkOrderRetrieve;subscribeToObservable(){this.orderProcessorService.Data$.subscribe(t=>{(t.posState==3||t.posState==5)&&this.emitParkReceipt(!0,t.posState==5)})}getParkedOrder(t,e){return this.httpService.get(ae.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(ae.VoidPark,i):this.httpService.post(ae.RemovePark,i)}mergePark(t){return this.httpService.post(ae.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(ae.GetOutStanding,e)}splitOrder(t){return this.httpService.post(ae.SplitOrder,t)}park(t){let e=tt(ct,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.DeliveryEntityID=S.GuidEmpty,e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,S.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(ae.ParkOrder,i).pipe(Ee(n=>{this.orderProcessorService.updatePosState(3,n),this.orderProcessorService.createNewTransactionInSameOutletRegister()}))}clearPromotionAppliedInPark(){this.dialog.open(br,{id:"modal-promotion-confirm",data:{message:`
2
2
  Promotion cannot be applied when Park,
3
3
  Order will be restored to before the promotion is applied
4
4
  `},disableClose:!0})}parkOrder(){let t=this.salesOrderService.Data,e=this.pageInitialService.Data.AppConfigJSON;if(t.CartItems.length==0){this.toastrService.warning("You must have at least one item","No Item in Cart!");return}if(!(!this.validateCustomerRequired(e,t)||!this.validateUsedPromotion(t))){if(S.IsEmpty(t.Order.RegisterID)){this.toastrService.warning(lr.emptyEntity,Be.Warning);return}this.validateShowParkModal()}}validateCustomerRequired(t,e){return t.ModuleSell.Header.CustomerRequired&&e.Order.CustomerID==null?(this.toastrService.warning("Customer is needed before parking orders!","Missing customer!"),!1):!0}validateUsedPromotion(t){let e=this.promotionEventService.selectedPromotion;return S.IsNotEmpty(e)||S.IsNotEmpty(t.Order.PromotionCoupon)?(this.toastrService.warning("Orders with applied promotions or coupons cannot be parked!","Park Not Allowed!"),!1):!0}validateShowParkModal(){let t=this.outletService.Data.ParkLayoutPack,e=this.pageInitialService.Data.AppConfigJSON,i=this.salesOrderService.Data;if(t&&S.IsNotEmpty(t.ID))this.orderProcessorService.Data.posState==4?this.showReparkModal():this.showParkSelectModal(e,i);else{if(!this.validateRetrieveMode(e))return;this.setDefaultParkNote(e),this.showParkInputModal()}}showParkSelectModal(t,e){let i=this.orderProcessorService.Data,n=this.outletService.Data.ParkLayoutPack;this.orderHttpService.getVacant(e.Order.EntityID).subscribe(l=>{let C=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle,R=i.posState==5,oe=t.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,Ce=R?"Split Order":C;this.dialog.open(Zt,{data:{title:Ce,parkLayoutPack:n,qty:e.TotalQuantity,entityId:e.Order.EntityID,occupied:l.Orders,replaceWithAlias:oe}})})}showReparkModal(){this.dialog.open(en,{data:this.parkOrderRetrieve})}validateRetrieveMode(t){return t.ApplicationParkAndRetrieve.Advance.retreiveMode==1?(this.toastrService.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!"),!1):!0}setDefaultParkNote(t){let e=t.ApplicationParkAndRetrieve.UserInterfaceLabel.DefaultParkNoteValue,i=this.orderProcessorService.Data.posState==2,n=this.salesOrderService.Data;!i&&S.IsNotEmpty(e)&&S.IsEmpty(n.Order.Note)&&(this.salesOrderService.Data.Order.Note=e)}showParkInputModal(){let t="Park this order?",e=this.orderProcessorService.Data.posState==5,i=this.outletService.Data?.ParkLayoutPack;e&&(t="Split Detail"),this.dialog.open(Yt,{id:"park-form-modal",data:{title:t,labelDisable:i&&S.IsNotEmpty(i?.ID)||this.orderProcessorService.Data.posState==5,ParkLabel:this.salesOrderService.Data.Order.ParkLabel}})}onPrintRetrieve(){this.dialog.open(Zi).afterClosed().pipe(se(t=>S.IsNotEmpty(t))).subscribe(t=>{t=="ORDER"?this.emitParkReceipt(!1,!1,!0):this.emitBillReceipt()})}emitParkReceipt(t,e=!1,i=!1){let n=this.receiptService.generateParkReceipt(t,e);(this.pageInitialService.Data.AppConfigJSON.ApplicationParkAndRetrieve?.PrintBehaviour?.PrintAfterPark||i)&&this._onPrint.next({type:"PARK",template:n})}emitBillReceipt(){let t=this.outletService.Data,e;1==t.PrintTemplate.PrintMode?(e=this.receiptService.generateBillInvoice(),this._onPrint.next({type:"BILL_A4",template:e})):(e=this.receiptService.generateBillReceipt(),this._onPrint.next({type:"BILL_MINI",template:e}))}static \u0275fac=function(e){return new(e||o)(L(Ne),L(Dt),L(q),L(A),L(N),L(z),L(Jt),L(Y),L(he),L(ne),L(Mt))};static \u0275prov=Je({token:o,factory:o.\u0275fac,providedIn:"root"})};var rn=class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=bt({type:o});static \u0275inj=Ct({imports:[te,xe,Ri,Pt,yr,Ii,Ft,Pi,Ke,ji]})};var na=o=>({"opacity-50":o});function Va(o,t){if(o&1){let e=v();r(0,"div",5)(1,"h6",6),p(2,"Verify Via"),a(),r(3,"div",7)(4,"button",8),f("click",function(){u(e);let n=d();return g(n.onChooseVerifyType("phone"))}),r(5,"div",9)(6,"div"),b(7,"i",10),a(),r(8,"div",11),p(9),a()()()(),r(10,"div",12)(11,"button",8),f("click",function(){u(e);let n=d();return g(n.onChooseVerifyType("email"))}),r(12,"div",9),b(13,"i",13),r(14,"div",11),p(15),a()()()(),r(16,"div",12)(17,"button",14),f("click",function(n){return u(e),d().onChooseVerifyType("pin"),g(n.preventDefault())}),r(18,"div",9),b(19,"i",15),r(20,"div",16),p(21,"Use PIN"),a()()()()()}if(o&2){let e=d();s(4),c("disabled",!e.phone||(e.phone==null?null:e.phone.length)<6),s(4),c("ngClass",E(6,na,!e.phone||(e.phone==null?null:e.phone.length)<6)),s(),y(" ",e.phone&&(e.phone==null?null:e.phone.length)>6?e.phone:"Mobile Phone is not registered"," "),s(2),c("disabled",!e.email),s(3),c("ngClass",E(8,na,!e.email)),s(),y(" ",e.email?e.email:"Email is not registered"," ")}}function Aa(o,t){if(o&1){let e=v();r(0,"div",17)(1,"div",18)(2,"div"),p(3,"OTP Verification is turned "),r(4,"span",19),p(5,"OFF"),a(),p(6,","),a(),r(7,"div"),p(8," Please read this "),r(9,"a",20),p(10,"article"),a(),p(11," to turn on "),a()()(),r(12,"div")(13,"div",21)(14,"button",22),f("click",function(){u(e);let n=d();return g(n.onRedeem())}),p(15,"Redeem"),a()()()}}var an=class o{toastrService=pe(z);onVerify=new He;pointUsedChange=new He;redeemEvent=new He;isVerifyEnabled=!1;phone;email;pointUsed;pointBalance;onPointUsedChange(){this.pointUsedChange.emit(this.pointUsed)}ngAfterViewInit(){this.setFocusInput()}setFocusInput(){setTimeout(()=>{document.getElementById("pointInput")?.focus()},300)}onChooseVerifyType(t){this.checkPointUsed()&&this.onVerify.emit(t)}onRedeem(){this.checkPointUsed()&&this.redeemEvent.emit()}checkPointUsed(){return S.IsEmpty(this.pointUsed)||this.pointUsed<=0?(this.toastrService.warning("Please enter the points before redeeming!","Field Input Required!"),this.setFocusInput(),!1):!0}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["point-step"]],inputs:{isVerifyEnabled:"isVerifyEnabled",phone:"phone",email:"email",pointUsed:"pointUsed",pointBalance:"pointBalance"},outputs:{onVerify:"onVerify",pointUsedChange:"pointUsedChange",redeemEvent:"onRedeem"},decls:13,vars:6,consts:[[1,"d-flex","align-items-center","justify-content-center"],[1,"me-3"],["type","text","autoNum","","id","pointInput",1,"form-control","input-point",3,"ngModelChange","ngModel","max"],[1,"me-3","d-flex","align-items-center","justify-content-center"],[1,"fs-1"],[1,"mt-8"],[1,"mb-6","text-center"],[1,"text-center"],["type","button",1,"btn","btn-light","btn-sm","p-3","w-75",3,"click","disabled"],[1,"d-flex","align-items-center"],[1,"fa-brands","fa-whatsapp","fs-2","ps-2",2,"color","#25d366"],[1,"fs-5","w-100",3,"ngClass"],[1,"mt-4","text-center"],[1,"ps-2","fa-solid","fa-envelope","fs-3",2,"color","#c71610"],["type","button","matTooltip","Inform the customer to download the Brand Loyalty App and setup PIN in Profile Menu to authorize Point Redemption","matTooltipPosition","right","matTooltipClass","primary-tooltip",1,"btn","btn-light","btn-sm","p-3","w-75",3,"click"],[1,"ps-2","fa-solid","fa-key","fs-3"],[1,"fs-5","w-100"],[1,"mt-8","d-flex","justify-content-center"],[1,"text-center","alert","alert-warning","py-4","px-8","mb-0"],[1,"fw-bold","text-danger",2,"font-size","13px"],["href","https://support.dealpos.com/en/articles/9158486-redeem-loyalty-point-authorization-using-otp","target","_blank"],[1,"d-flex","justify-content-center","mt-12"],[1,"btn","btn-success",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"input",2),k("ngModelChange",function(l){return w(i.pointUsed,l)||(i.pointUsed=l),l}),f("ngModelChange",function(){return i.onPointUsedChange()}),a()(),r(3,"div",3)(4,"span",1),p(5,"Of"),a(),r(6,"span",4),p(7),h(8,"number"),a()(),r(9,"div"),p(10,"Points"),a()(),_(11,Va,22,10,"div",5)(12,Aa,16,0)),e&2&&(s(2),D("ngModel",i.pointUsed),c("max",i.pointBalance),s(5),T(I(8,4,i.pointBalance)),s(4),B(i.isVerifyEnabled?11:12))},dependencies:[te,J,X,ut,st,xe,Z,K,ie,Ke,de],styles:[".input-point[_ngcontent-%COMP%]{width:120px;height:44px;font-size:1.375rem;text-align:center}"]})};var La=o=>({"error-input":o});function Ba(o,t){if(o&1&&(r(0,"span"),p(1),a()),o&2){let e=d(3);s(),y(" ",e.config.separator," ")}}function Fa(o,t){if(o&1){let e=v();O(0),r(1,"input",5,0),f("paste",function(n){u(e);let l=d(2);return g(l.handlePaste(n))})("keyup",function(n){let l=u(e).index,C=d(2);return g(C.onKeyUp(n,l))})("input",function(n){let l=u(e).index,C=d(2);return g(C.onInput(n,l))})("keydown",function(n){let l=u(e).index,C=d(2);return g(C.onKeyDown(n,l))}),a(),_(3,Ba,2,1,"span",6),x()}if(o&2){let e=t.$implicit,i=t.index,n=t.last,l=d(2);s(),zn("otp-input ",l.config.inputClass,""),c("pattern",l.config.allowNumbersOnly?"\\d*":"")("type",l.inputType)("placeholder",(l.config==null?null:l.config.placeholder)||"")("ngStyle",l.config.inputStyles)("formControl",l.otpForm.controls[e])("id",l.getBoxId(i))("ngClass",E(11,La,(l.config==null?null:l.config.showError)&&(l.formControl==null?null:l.formControl.invalid)&&((l.formControl==null?null:l.formControl.dirty)||(l.formControl==null?null:l.formControl.touched)))),s(2),c("ngIf",l.config.separator&&!n)}}function ja(o,t){if(o&1){let e=v();r(0,"div",2),f("focusin",function(){u(e);let n=d();return g(n.onFocusIn())})("focusout",function(){u(e);let n=d();return g(n.onFocusOut())}),r(1,"div",3),_(2,Fa,4,13,"ng-container",4),a()()}if(o&2){let e=d();zn("ng-otp-input-wrapper wrapper ",e.config.containerClass,""),xo("id","c_",e.componentKey,""),c("ngStyle",e.config.containerStyles),s(2),c("ngForOf",e.controlKeys)}}var ft=class{static ifTab(t){return this.ifKey(t,"Tab")}static ifDelete(t){return this.ifKey(t,"Delete;Del")}static ifBackspace(t){return this.ifKey(t,"Backspace")}static ifRightArrow(t){return this.ifKey(t,"ArrowRight;Right")}static ifLeftArrow(t){return this.ifKey(t,"ArrowLeft;Left")}static ifSpacebar(t){return this.ifKey(t,"Spacebar; ")}static ifKey(t,e){return e.split(";").some(n=>n===t.key)}},fi=class{static keys(t){return t?Object.keys(t):[]}},oo=(()=>{class o{set disabled(e){this.setDisabledState(e)}get inputType(){return this.config?.isPasswordInput?"password":this.config?.allowNumbersOnly?"tel":"text"}get controlKeys(){return fi.keys(this.otpForm?.controls)}get formControl(){return this.formCtrl??this.inj?.get(Ao)}constructor(e,i){this.document=e,this.inj=i,this.config={length:4},this.onBlur=new $,this.onInputChange=new $,this.inputControls=new Array(this.config.length),this.componentKey=Math.random().toString(36).substring(2)+new Date().getTime().toString(36),this.destroy$=new $,this.activeFocusCount=0,this.onChange=()=>{},this.onTouched=()=>{},this._isDisabled=!1}ngOnInit(){this.otpForm=new Lo({});for(let e=0;e<this.config.length;e++)this.otpForm.addControl(this.getControlName(e),new yt);this.otpForm.valueChanges.pipe(P(this.destroy$)).subscribe(e=>{fi.keys(this.otpForm.controls).forEach(i=>{var n=this.otpForm.controls[i].value;n&&n.length>1&&(n.length>=this.config.length?this.setValue(n):this.rebuildValue())})})}setDisabledState(e){this._isDisabled=e,this.otpForm&&(e?this.otpForm.disable({emitEvent:!1}):this.otpForm.enable({emitEvent:!1}))}writeValue(e){this.currentVal=this.hasVal(e)?e:null,this.setValue(this.currentVal)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}onFocusIn(){this.onTouched(),this.activeFocusCount++}onFocusOut(){setTimeout(()=>{this.activeFocusCount--,this.activeFocusCount===0&&(this.onTouched(),this.onBlur.next())},0)}ngAfterViewInit(){if(!this.config.disableAutoFocus){let e=this.document.getElementById(`c_${this.componentKey}`);if(e){let i=e.getElementsByClassName("otp-input")[0];i&&i.focus&&i.focus()}}}getControlName(e){return`ctrl_${e}`}onKeyDown(e,i){let n=this.getBoxId(i-1),l=this.getBoxId(i);if(ft.ifKey(e,"Enter")){let R=this.document.getElementById(l)?.closest("form");if(R){e.preventDefault(),R.dispatchEvent(new Event("submit"));return}}if(ft.ifSpacebar(e))return e.preventDefault(),!1;if(ft.ifBackspace(e)){e.target.value?this.clearInput(l,i):(this.clearInput(n,i-1),this.setSelected(n)),this.rebuildValue();return}if(ft.ifDelete(e)){e.target.value?this.clearInput(l,i):(this.clearInput(n,i-1),this.setSelected(n)),this.rebuildValue();return}}hasVal(e){return e!=null&&e!=null&&(!e?.trim||e.trim()!="")}onInput(e,i){let n=this.hasVal(this.currentVal)?`${this.currentVal}${e.target.value}`:e.target.value;if(this.config.allowNumbersOnly&&!this.validateNumber(n)){e.target.value=null,e.stopPropagation(),e.preventDefault(),this.clearInput(null,i);return}if(this.ifValidKeyCode(null,e.target.value)){let l=this.getBoxId(i+1);this.setSelected(l),this.rebuildValue()}else{e.target.value=null;let l=this.getControlName(i);this.otpForm.controls[l]?.setValue(null),this.rebuildValue()}}onKeyUp(e,i){ft.ifTab(e)&&(i-=1);let n=this.getBoxId(i+1),l=this.getBoxId(i-1);if(ft.ifRightArrow(e)){e.preventDefault(),this.setSelected(n);return}if(ft.ifLeftArrow(e)){e.preventDefault(),this.setSelected(l);return}}validateNumber(e){return e&&/^[0-9]+$/.test(e)}getBoxId(e){return`otp_${e}_${this.componentKey}`}clearInput(e,i){let n=this.getControlName(i);if(this.otpForm.controls[n]?.setValue(null),e){let l=this.document.getElementById(e);l&&l instanceof HTMLInputElement&&(l.value=null)}}setSelected(e){this.focusTo(e);let i=this.document.getElementById(e);i&&i.setSelectionRange&&setTimeout(()=>{i.setSelectionRange(0,1)},0)}ifValidKeyCode(e,i){let n=i??e.key;return this.config?.allowNumbersOnly?this.validateNumber(n):/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)||/^[a-zA-Z0-9%*_\-@#$!]$/.test(n)&&n.length==1}focusTo(e){let i=this.document.getElementById(e);i&&i.focus()}setValue(e){if(!(this.config.allowNumbersOnly&&isNaN(e))){if(this.otpForm?.reset(),!this.hasVal(e)){this.rebuildValue();return}e=e.toString().replace(/\s/g,""),Array.from(e).forEach((i,n)=>{this.otpForm.get(this.getControlName(n))&&this.otpForm.get(this.getControlName(n)).setValue(i)}),this.config.disableAutoFocus||setTimeout(()=>{let i=this.document.getElementById(`c_${this.componentKey}`);var n=e.length<this.config.length?e.length:this.config.length-1;let l=i.getElementsByClassName("otp-input")[n];l&&l.focus&&setTimeout(()=>{l.focus()},1)},0),this.rebuildValue()}}rebuildValue(){let e=null;fi.keys(this.otpForm.controls).forEach(i=>{let n=this.otpForm.controls[i].value;if(n){let l=n.length>1,C=!this.config.allowNumbersOnly&&this.config.letterCase&&(this.config.letterCase.toLocaleLowerCase()=="upper"||this.config.letterCase.toLocaleLowerCase()=="lower");n=n[0];let R=C?this.config.letterCase.toLocaleLowerCase()=="upper"?n.toUpperCase():n.toLowerCase():n;C&&R==n?C=!1:n=R,e==null?e=n:e+=n,(l||C)&&this.otpForm.controls[i].setValue(n)}}),this.currentVal!=e&&(this.currentVal=e,this.onChange(e),this.formCtrl?.setValue&&this.formCtrl.setValue(e),this.onInputChange.next(e))}handlePaste(e){let i=e.clipboardData||window.clipboardData;if(i)var n=i.getData("Text");e.stopPropagation(),e.preventDefault(),!(!n||this.config.allowNumbersOnly&&!this.validateNumber(n))&&this.setValue(n)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||o)(m(Mo),m(vo))}}static{this.\u0275cmp=M({type:o,selectors:[["ng-otp-input"],["ngx-otp-input"]],inputs:{config:"config",formCtrl:"formCtrl",disabled:"disabled"},outputs:{onBlur:"onBlur",onInputChange:"onInputChange"},features:[at([{provide:No,useExisting:bo(()=>o),multi:!0}])],decls:1,vars:1,consts:[["inp",""],["tabindex","0",3,"class","id","ngStyle","focusin","focusout",4,"ngIf"],["tabindex","0",3,"focusin","focusout","id","ngStyle"],[1,"n-o-c"],[4,"ngFor","ngForOf"],["autocomplete","one-time-code",3,"paste","keyup","input","keydown","pattern","type","placeholder","ngStyle","formControl","id","ngClass"],[4,"ngIf"]],template:function(i,n){i&1&&_(0,ja,3,7,"div",1),i&2&&c("ngIf",n.otpForm==null?null:n.otpForm.controls)},dependencies:[ze,Z,K,Fo,Ot,U,fe,Do,J],styles:[".otp-input[_ngcontent-%COMP%]{width:50px;height:50px;border-radius:4px;border:solid 1px #c5c5c5;text-align:center;font-size:32px}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]{margin:0 .51rem}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]:first-child{margin-left:0}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]:last-child{margin-right:0}.n-o-c[_ngcontent-%COMP%]{display:flex;align-items:center}.error-input[_ngcontent-%COMP%]{border-color:red}@media screen and (max-width: 767px){.otp-input[_ngcontent-%COMP%]{width:40px;font-size:24px;height:40px}}@media screen and (max-width: 420px){.otp-input[_ngcontent-%COMP%]{width:30px;font-size:18px;height:30px}}"]})}}return o})(),sn=(()=>{class o{static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275mod=bt({type:o})}static{this.\u0275inj=Ct({imports:[oo]})}}return o})();function Ua(o,t){if(o&1&&(r(0,"div"),p(1," OTP has been sent to "),r(2,"span",5),p(3),a()()),o&2){let e=d();s(3),T(e.contact)}}function Wa(o,t){if(o&1&&b(0,"ng-otp-input",3),o&2){let e=d(2);c("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function Qa(o,t){if(o&1&&_(0,Wa,1,2,"ng-otp-input",3),o&2){let e=d();B(e.showPinInput()?0:-1)}}function qa(o,t){if(o&1&&b(0,"ng-otp-input",3),o&2){let e=d();c("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function $a(o,t){if(o&1){let e=v();r(0,"div",4)(1,"span"),p(2,"Didn`t get a code? "),a(),r(3,"a",6),f("click",function(){u(e);let n=d();return g(n.onResendCode())}),p(4,"Click to resend"),a()()}}var cn=class o{type;contact;clearPin=!1;onVerify=new He;resendCode=new He;showPinInput=ce(!0);otpCtrl=new yt;otpConfig={length:6,inputStyles:{width:"3rem",height:"3rem"},isPasswordInput:!1,placeholder:"-"};constructor(){this.listenOtpChange()}ngOnChanges(t){let{clearPin:e}=t;e?.currentValue&&(this.showPinInput.set(!1),setTimeout(()=>{this.showPinInput.set(!0)},0)),this.type&&(this.otpConfig.isPasswordInput=this.type==="pin")}onResendCode(){this.resendCode.emit()}listenOtpChange(){this.otpCtrl.valueChanges.pipe(Co(300),se(t=>t.length===6)).subscribe(t=>{this.onVerify.emit(t)})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["verify-step"]],inputs:{type:"type",contact:"contact",clearPin:"clearPin"},outputs:{onVerify:"onVerify",resendCode:"resendCode"},features:[ho],decls:8,vars:4,consts:[[1,"text-center","mb-10"],[1,"mb-3","fw-normal"],[1,"d-flex","justify-content-center"],[3,"formCtrl","config"],[1,"mt-4","text-start"],[1,"fw-bold"],[1,"link-primary","cursor-pointer",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"h4",1),p(2),a(),_(3,Ua,4,1,"div"),a(),r(4,"div",2),_(5,Qa,1,1)(6,qa,1,2,"ng-otp-input",3),a(),_(7,$a,5,0,"div",4)),e&2&&(s(2),y(" Confirm Your ",i.type=="pin"?"PIN":"OTP"," "),s(),B(i.type!="pin"?3:-1),s(2),B(i.type=="pin"?5:6),s(2),B(i.type!="pin"?7:-1))},dependencies:[te,sn,oo,ze],encapsulation:2})};function Ja(o,t){if(o&1){let e=v();r(0,"button",7),f("click",function(){u(e);let n=d();return g(n.onCancel())}),p(1,"Cancel"),a()}}function Ga(o,t){if(o&1){let e=v();r(0,"button",8),f("click",function(){u(e);let n=d();return g(n.onConfirm())}),p(1,"Confirm"),a()}}var pn=class o{pointUsed=hi(0);redeemPointValue=hi(0);showCancelBtn=hi(!1);confirmEvent=new He;cancelEvent=new He;onConfirm(){this.confirmEvent.emit()}onCancel(){this.cancelEvent.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["confirm-step"]],inputs:{pointUsed:[1,"pointUsed"],redeemPointValue:[1,"redeemPointValue"],showCancelBtn:[1,"showCancelBtn"]},outputs:{confirmEvent:"onConfirm",cancelEvent:"onCancel"},decls:19,vars:7,consts:[[1,"text-center"],[1,"fs-5"],[1,"d-flex","justify-content-center","text-success","align-items-center"],[1,"me-3",2,"font-size","1.5rem"],[1,"d-flex","justify-content-center","text-danger","align-items-center"],[1,"btn","btn-danger","mt-12"],[1,"btn","btn-success","mt-12"],[1,"btn","btn-danger","mt-12",3,"click"],[1,"btn","btn-success","mt-12",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1),p(2,"Redeem"),a(),r(3,"div",2)(4,"span",3),p(5),h(6,"number"),a(),r(7,"small"),p(8,"Point"),a()(),r(9,"div",1),p(10,"~"),a(),r(11,"div",4)(12,"span",3),p(13),h(14,"number"),a(),r(15,"small"),p(16,"Discount"),a()(),_(17,Ja,2,0,"button",5)(18,Ga,2,0,"button",6),a()),e&2&&(s(5),T(I(6,3,i.pointUsed())),s(8),T(I(14,5,i.pointUsed()*i.redeemPointValue())),s(4),B(i.showCancelBtn()?17:18))},dependencies:[te,X],encapsulation:2})};var ii=class o{constructor(t,e,i,n,l,C,R,oe,Ce){this.customerHttpService=t;this.salesOrderService=e;this.pageInitialService=i;this.shoppingCartService=n;this.invoiceCalculatorService=l;this.orderProcessorService=C;this.toastr=R;this.promotionCouponService=oe;this.httpService=Ce}customerId;customerData;_isCustomerVerfiedOtp=!1;get isCustomerVerfiedOtp(){return this._isCustomerVerfiedOtp}addCustomerById(t){return new fo(e=>{this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this.resetCartOnChangeCustomer(t),S.IsNotEmpty(t)&&this.salesOrderService.updateCustomerID(t).then(i=>{this.applyCustomerPricebook(i),this.updateTaxCustomer(i.TaxTypeId),this.setSalesOrderCustomerId(i),this.setCustomerData(i),this.customerData.DiscountRate==null&&(this.customerData.DiscountRate=0),this._isCustomerVerfiedOtp=!1,this.applyConfigFullPriceOnly(),this.salesOrderService.pushNewValue();let n=this.checkResetRedeemPoint();this.orderProcessorService.reedemPointToDiscount(n),e.next(i)})})}addCustomerByCode(t){return this.salesOrderService.Data.ContactName=null,this.customerHttpService.findCustomerByCode(t).pipe(Oe(e=>(this.salesOrderService.Data.ContactName=e.Display,this.addCustomerById(e.ID))))}setSalesOrderCustomerId(t){let e=this.salesOrderService.Data;S.IsNotEmpty(t.SalesID)&&(e.Order.SalesID=t.SalesID)}setCustomerData(t){let e=this.salesOrderService.Data;if(t.EntityID==S.GuidEmpty)this.customerData=t;else if(t.EntityID!=e.Order.EntityID){e.Order.CustomerID=null,e.ContactName=null;let i=`${t?.Name} is exclusive to ${t?.EntityName} Outlet and cannot be used in other outlets!`;alert(i)}else this.customerData=t}checkResetRedeemPoint(){let t=!1;return S.IsNotEmpty(this.customerId)&&(t=!0),t}applyCustomerPricebook(t){let e=this.salesOrderService.Data;if(S.IsNotEmpty(t.PricebookID)){let i=e.CartItems.map(n=>(n.Variant.PriceBook&&n.Variant.PriceBook.length!==0&&n.Variant.PriceBook.forEach(l=>{l.ID===t.PricebookID&&n.Quantity>=l.MinimumQuantity&&(n=this.shoppingCartService.applyPricebookToItem(n,l))}),n));e.CartItems=i}}updateTaxCustomer(t){let i=this.pageInitialService.Data.Taxes.find(n=>n.ID==t);i&&(this.salesOrderService.Data.Order.TaxTypeID=i.ID,this.invoiceCalculatorService.tax=i)}resetCartOnChangeCustomer(t){let e=this.pageInitialService.Data.AppConfigJSON;this.customerId!=t&&e.ModuleSell.Customer.ClearCartOnChange&&(this.salesOrderService.Data.CartItems=[]),this.customerId=t}updateDiscountRate(t=0){if(t>0){let e=this.promotionCouponService.coupon,i=this.salesOrderService.Data.Order.Discount;e&&e.Requirement?.Type==1?i==e.Amount?t>e.Amount&&(this.toastr.warning("Member discount is applied because member discount is greater than Coupon Discount","Warning"),this.promotionCouponService.resetAppliedCouponDiscount(),this.salesOrderService.Data.Order.Discount=t):(this.salesOrderService.Data.Order.Discount=t,this.salesOrderService.Data.Order.CustomerDiscountRate=t):(this.salesOrderService.Data.Order.Discount=t,this.salesOrderService.Data.Order.CustomerDiscountRate=t)}}applyConfigFullPriceOnly(){let t=this.filterGroupByDiscountRate(),e=this.salesOrderService.Data.CartItems;t?.OrderDiscountFullPriceProductOnly?this.filterItemWithDisc(e).length>0?e=this.applyItemsDisc(e,this.customerData.DiscountRate):this.updateDiscountRate(this.customerData.DiscountRate):this.updateDiscountRate(this.customerData.DiscountRate)}filterGroupByDiscountRate(){let e=(this.customerData?.Groups?this.customerData?.Groups:[]).filter(n=>n.OrderDiscountPercentage==this.customerData.DiscountRate),i;return e.length>1?(i=e.find(n=>n.OrderDiscountFullPriceProductOnly==!0),i||(i=e[0])):i=e[0],i}applyItemsDisc(t,e){return t=t.map(i=>(i.Discount==0&&i.DiscountAmount==0&&i.PriceTypeID!=3&&i.Price==i.UnitPrice&&S.IsEmpty(i.PriceBookID)&&(i.Discount=e,i.HasCustomerDiscount=!0),i)),t}filterItemWithDisc(t){return t.filter(i=>i.Discount>0||i.DiscountAmount>0||i.PriceTypeID==3||i.Price!=i.UnitPrice||S.IsNotEmpty(i.PriceBookID))}onEmptyInputCustomer(){S.IsNotEmpty(this.customerId)&&(this.promotionCouponService.resetAppliedCouponDiscount(),this.resetAppliedPoint(),this.resetCustomerPricebook(),this.removeCustomerDiscountRate()),this.orderProcessorService.Data.InputTextValue="",this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this._isCustomerVerfiedOtp=!1,this.customerData=null,this.salesOrderService.Data.ContactName=null,this.salesOrderService.Data.Order.CustomerID=null,this.customerHttpService.Data=new Kn,this.customerData=new Kn,this.salesOrderService.pushNewValue()}removeCustomerDiscountRate(){let t=this.filterGroupByDiscountRate(),e=this.salesOrderService.Data.CartItems;t?.OrderDiscountFullPriceProductOnly?this.filterItemWithDisc(e).length>0?this.salesOrderService.Data.CartItems=e.map(n=>(n.HasCustomerDiscount&&(n.Discount=0,n.HasCustomerDiscount=!1),n)):(this.salesOrderService.Data.Order.Discount=0,this.salesOrderService.Data.Order.CustomerDiscountRate=0):(this.salesOrderService.Data.Order.Discount=0,this.salesOrderService.Data.Order.CustomerDiscountRate=0)}resetCustomerPricebook(){if(this.customerData){let t=this.customerData.PricebookID;if(S.IsNotEmpty(t)){let e=this.salesOrderService.Data.CartItems;this.salesOrderService.Data.CartItems=e.map(i=>(i.PriceBookID==t&&(i.Discount=i.Variant.PriceDiscount,i.Note=i.Variant.PriceNote,i.PriceNote=i.Variant.PriceNote,i.PriceBookID=S.GuidEmpty,i.Price=i.Variant.UnitPrice,i.UnitPrice=i.Variant.UnitPrice),i))}}}resetAppliedPoint(){let t=this.salesOrderService.Data;t.Order.PointUsed>0&&(t.Order.PointUsed=0,t.Order.DiscountAmount=0)}redeemPoint(t){let e=this.pageInitialService.Data.AppConfigJSON,i=this.salesOrderService.Data,n=e.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,l=t*n,C=i.RedeemableAmount;l>C&&(n>0?(t=Math.ceil(C/n),l=C):(t=0,l=0),this.toastr.warning("You enter the number of points more than the total amount","Points Adjusted")),i.Order.PointUsed=t||0,i.Order.DiscountAmount=l,this.salesOrderService.pushNewValue(i)}sendOtpViaEmail(t){return this.httpService.post("/API/otp/email",{Email:t})}sendOtpViaWhatsApp(t){return this.httpService.post("/API/otp/WhatsApp",{Number:t})}verifyEmailOtp(t,e){return this.httpService.post("/API/otp/verifyemail",{Email:t,OTP:e}).pipe(Ee(()=>this._isCustomerVerfiedOtp=!0))}verifyPin(t,e){return this.httpService.post("/API/pos/VerifyPin",{PIN:t,CustomerID:e}).pipe(Ee(()=>this._isCustomerVerfiedOtp=!0))}verifyWhatsAppOtp(t,e){return this.httpService.post("/API/otp/verifywhatsapp",{Number:t,OTP:e}).pipe(Ee(()=>this._isCustomerVerfiedOtp=!0))}get pointBalanced(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed;return(t||0)-(e||0)}static \u0275fac=function(e){return new(e||o)(L(pt),L(N),L(A),L(Le),L(Pe),L(q),L(z),L($t),L(Ne))};static \u0275prov=Je({token:o,factory:o.\u0275fac,providedIn:"root"})};var Xa=["stepper"];function Za(o,t){o&1&&p(0,"Points")}function el(o,t){o&1&&p(0,"Verify")}function tl(o,t){o&1&&p(0,"Confirm")}var ni=class o{dialogRef=pe(j);outletRegisterService=pe(Y);pageInitialService=pe(A);customerHttpService=pe(pt);customerService=pe(ii);orderService=pe(N);toastr=pe(z);modalConfig;enabledLoyaltyPoint=ce(!1);stepper;pointUsed=0;pointBalance=ce(0);redeemPointValue=ce(0);email=ce(null);phone=ce(null);contactToResend=ce(null);verifyType=ce(null);clearPin=ce(!1);selectedTab=ce(0);constructor(){this.initModalConfig();let t=this.pageInitialService.Data.AppConfigJSON;this.redeemPointValue.set(t?.ApplicationLoyalty?.LoyaltyPoint?.RedeemPointValue),this.email.set(this.customerHttpService.Data?.Email),this.phone.set(this.customerHttpService.Data?.Mobile),this.initAvailablePoint(),this.initConfigEnabledVerify(),this.initPointUsed()}initModalConfig(){this.modalConfig=new W,this.modalConfig.title="Redeem Point",this.modalConfig.customWidth="500px",this.modalConfig.hideFooter=!0}initConfigEnabledVerify(){let t=this.pageInitialService.Data.AppConfigJSON,e=t?.ApplicationLoyalty?.VerifyRedemption,i=t?.ApplicationLoyalty?.Enabled,n=this.outletRegisterService.Data?.MemberPoint;this.enabledLoyaltyPoint.set(e&&i&&n)}initPointUsed(){let t=this.orderService.Data?.Order?.PointUsed;this.pointUsed=t||0,this.pointUsed>0&&this.selectedTab.set(2)}initAvailablePoint(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed,i=(t||0)-(e||0);this.pointBalance.set(i)}onClose(){this.dialogRef.close()}onCancelRedeem(){let t=this.orderService.Data;t.Order.PointUsed=0,t.Order.DiscountAmount=0,this.orderService.pushNewValue(t),this.toastr.info("Redeem point has been canceled","Canceled"),this.onClose()}onRedeem(){this.stepper.next(),this.stepper.next()}onVerify(t){switch(t){case"phone":this.contactToResend.set(this.phone()),this.handlingSentOtpViaPhone();break;case"email":this.contactToResend.set(this.email()),this.handlingSentOtpViaEmail();break;case"pin":this.stepper.next();break}this.verifyType.set(t)}handlingSentOtpViaPhone(){this.customerService.sendOtpViaWhatsApp(this.phone()).subscribe(t=>{this.stepper.selectedIndex==0&&this.stepper.next(),this.toastr.success(`OTP has been sent to ${this.phone()}`,"OTP Sent")})}handlingSentOtpViaEmail(){this.customerService.sendOtpViaEmail(this.email()).subscribe(t=>{this.stepper.selectedIndex==0&&this.stepper.next(),this.toastr.success(`OTP has been sent to ${this.email()}`,"Email Sent")})}onVerifyCode(t){switch(this.verifyType()){case"phone":this.verifyPhoneOtp(t);break;case"email":this.verifyEmailOtp(t);break;case"pin":this.verifyCustomerPin(t);break}}verifyEmailOtp(t){this.customerService.verifyEmailOtp(this.email(),t).subscribe(e=>{this.toastr.success(e.Message,"Successfully verified"),this.stepper.next()})}verifyPhoneOtp(t){this.customerService.verifyWhatsAppOtp(this.phone(),t).subscribe(e=>{this.toastr.success(e.Message,"Successfully verified"),this.stepper.next()})}verifyCustomerPin(t){let e=this.orderService.Data?.Order?.CustomerID;this.clearPin.set(!1),this.customerService.verifyPin(t,e).subscribe({next:i=>{this.toastr.success(i.Message,"Successfully verified"),this.stepper.next()},error:i=>{this.clearPin.set(!0)}})}onResendCode(){this.onVerify(this.verifyType())}onConfirm(){this.calculatePointToDiscount()}calculatePointToDiscount(){let t=this.pageInitialService.Data.AppConfigJSON,e=this.orderService.Data,i=e.RedeemableAmount,n=this.pointUsed,l=t.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,C=this.pointUsed*l;C>i&&(n=Math.ceil(i/l),C=i),(S.IsNotEmpty(e.Order.PointUsed)?e.Order.PointUsed:0)!=n&&(e.Order.PointUsed=n||0,e.Order.DiscountAmount=C,this.orderService.pushNewValue(e),this.toastr.success("Point has been redeemed","Success")),this.dialogRef.close()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["modal-redeem-point"]],viewQuery:function(e,i){if(e&1&&De(Xa,5),e&2){let n;we(n=ke())&&(i.stepper=n.first)}},decls:18,vars:18,consts:[["stepper",""],[3,"onClose","preventEnterEvent","config"],[1,"container"],[1,"d-flex","justify-content-center"],[1,"sell-stepper-redeem",3,"linear","selectedIndex"],[3,"editable","aria-labelledby"],["matStepLabel",""],[1,"mt-10"],[3,"onVerify","pointUsedChange","onRedeem","isVerifyEnabled","pointUsed","pointBalance","email","phone"],["aria-labelledby","stepDisabled",3,"editable"],[3,"resendCode","onVerify","type","contact","clearPin"],["aria-labelledby","stepDisabled"],[3,"onConfirm","onCancel","pointUsed","redeemPointValue","showCancelBtn"]],template:function(e,i){if(e&1){let n=v();r(0,"modal-material",1),f("onClose",function(){return u(n),g(i.onClose())}),r(1,"content")(2,"div",2)(3,"div",3)(4,"mat-stepper",4,0)(6,"mat-step",5),_(7,Za,1,0,"ng-template",6),r(8,"div",7)(9,"point-step",8),f("onVerify",function(C){return u(n),g(i.onVerify(C))}),k("pointUsedChange",function(C){return u(n),w(i.pointUsed,C)||(i.pointUsed=C),g(C)}),f("onRedeem",function(){return u(n),g(i.onRedeem())}),a()()(),r(10,"mat-step",9),_(11,el,1,0,"ng-template",6),r(12,"div",7)(13,"verify-step",10),f("resendCode",function(){return u(n),g(i.onResendCode())})("onVerify",function(C){return u(n),g(i.onVerifyCode(C))}),a()()(),r(14,"mat-step",11),_(15,tl,1,0,"ng-template",6),r(16,"div",7)(17,"confirm-step",12),f("onConfirm",function(){return u(n),g(i.onConfirm())})("onCancel",function(){return u(n),g(i.onCancelRedeem())}),a()()()()()()()()}e&2&&(c("preventEnterEvent",!0)("config",i.modalConfig),s(4),c("linear",!0)("selectedIndex",i.selectedTab()),s(2),c("editable",!0)("aria-labelledby",i.selectedTab()==2?"stepDisabled":""),s(3),c("isVerifyEnabled",i.enabledLoyaltyPoint()),D("pointUsed",i.pointUsed),c("pointBalance",i.pointBalance())("email",i.email())("phone",i.phone()),s(),c("editable",!1),s(3),c("type",i.verifyType())("contact",i.contactToResend())("clearPin",i.clearPin()),s(4),c("pointUsed",i.pointUsed)("redeemPointValue",i.redeemPointValue())("showCancelBtn",i.selectedTab()==2))},dependencies:[te,Qe,Q,xe,Ur,jr,Fr,Hr,an,cn,pn],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons"; mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header{height:50px!important} mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header .mat-step-label{min-width:0px!important} mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header[aria-labelledby=stepDisabled]{pointer-events:none!important}']})};function il(o,t){if(o&1){let e=v();O(0),r(1,"div",16),f("click",function(){u(e);let n=d(2);return g(n.onShowModalRedeem())}),r(2,"span"),b(3,"i",17),a(),r(4,"span"),p(5),h(6,"number"),a()(),x()}if(o&2){let e=d(2);s(5),y(" ",I(6,1,e.pointUsed)," Points redeemed ")}}function nl(o,t){if(o&1){let e=v();O(0),r(1,"tab",4)(2,"div",5)(3,"div",6)(4,"label",7),p(5,"Discount %"),a()(),r(6,"div",8)(7,"input",9),k("ngModelChange",function(n){u(e);let l=d();return w(l.discount1,n)||(l.discount1=n),g(n)}),a(),r(8,"span",10),p(9,"%"),a(),r(10,"span",11),p(11,"+"),a(),r(12,"input",12),k("ngModelChange",function(n){u(e);let l=d();return w(l.discount2,n)||(l.discount2=n),g(n)}),a(),r(13,"span",10),p(14,"%"),a()()(),r(15,"div",13)(16,"div",6)(17,"label",7),p(18),a()(),r(19,"div",14)(20,"input",15),k("ngModelChange",function(n){u(e);let l=d();return w(l.discountAmount,n)||(l.discountAmount=n),g(n)}),a(),_(21,il,7,3,"ng-container",3),a()()(),x()}if(o&2){let e=d();s(),c("active",e.tabActive=="Discount"),s(6),D("ngModel",e.discount1),s(5),D("ngModel",e.discount2),s(6),y("Discount ",e.currencySymbol,""),s(2),c("disabled",e.pointUsed&&e.pointUsed>0),D("ngModel",e.discountAmount),s(),c("ngIf",e.pointUsed&&e.pointUsed>0)}}function ol(o,t){if(o&1){let e=v();O(0),r(1,"tab",18)(2,"div",5)(3,"div",6)(4,"label",7),p(5,"Tax"),a()(),r(6,"div",8)(7,"ng-select",19),f("change",function(n){u(e);let l=d();return g(l.updateTax(n))}),a()()(),r(8,"div",13)(9,"div",6)(10,"label",7),p(11,"Surcharge"),a()(),r(12,"div",8)(13,"input",20),k("ngModelChange",function(n){u(e);let l=d();return w(l.surcharge,n)||(l.surcharge=n),g(n)}),a(),r(14,"span",10),p(15,"%"),a()()()(),x()}if(o&2){let e=d();s(7),c("clearable",!1)("ngModel",e.salesOrder.Order.TaxTypeID)("items",e.taxes),s(6),D("ngModel",e.surcharge),c("max",100)("min",-100)}}function rl(o,t){if(o&1){let e=v();O(0),r(1,"tab",21)(2,"div",5)(3,"div",22)(4,"strong"),p(5,"Discount After Tax"),a()(),r(6,"div",23)(7,"input",24),k("ngModelChange",function(n){u(e);let l=d();return w(l.discountAfterTax,n)||(l.discountAfterTax=n),g(n)}),f("ngModelChange",function(){u(e);let n=d();return g(n.onDiscountAfterTaxChange())}),a()()(),r(8,"div",25)(9,"div",22)(10,"label",7),p(11,"Discount Calculator"),a()(),r(12,"div",26)(13,"input",27),k("ngModelChange",function(n){u(e);let l=d();return w(l.discounts[0],n)||(l.discounts[0]=n),g(n)}),f("ngModelChange",function(){u(e);let n=d();return g(n.calculateDiscountCalculator())}),a(),r(14,"span"),p(15," %"),a(),r(16,"span",11),p(17,"+"),a(),r(18,"input",28),k("ngModelChange",function(n){u(e);let l=d();return w(l.discounts[1],n)||(l.discounts[1]=n),g(n)}),f("ngModelChange",function(){u(e);let n=d();return g(n.calculateDiscountCalculator())}),a(),r(19,"span"),p(20," %"),a(),r(21,"span",11),p(22,"+"),a(),r(23,"input",29),k("ngModelChange",function(n){u(e);let l=d();return w(l.discounts[2],n)||(l.discounts[2]=n),g(n)}),f("ngModelChange",function(){u(e);let n=d();return g(n.calculateDiscountCalculator())}),a(),r(24,"span"),p(25," %"),a()()()(),x()}if(o&2){let e=d();s(7),D("ngModel",e.discountAfterTax),s(6),D("ngModel",e.discounts[0]),s(5),D("ngModel",e.discounts[1]),s(5),D("ngModel",e.discounts[2])}}var oi=class o{constructor(t,e,i,n,l,C,R,oe,Ce,dt){this.dialogRef=t;this.orderService=e;this.invoiceCalculatorService=i;this.pageInitialService=n;this.roleService=l;this.customerHttpService=C;this.orderProcessorService=R;this.promotionCouponService=oe;this.dialog=Ce;this.data=dt;let ot=this.pageInitialService?.Data?.AppConfigJSON;this.modalConfig.title="Discount and Tax",this.modalConfig.customWidth="480px",this.salesOrder=this.orderService.Data,this.userRole=this.roleService.Data,this.isPreferedPayment=ot?.ApplicationLoyalty?.PreferedPayment,this.tabActive=this.data?.tabIndexActive,this.isEditOrder=this.orderProcessorService.Data.posState==2,this.customer=C.Data,this.initDiscountAndTax(),this.initAvailablePoint(),this.initTabLoyaltyTitle()}modalConfig=new W;discount1;discount2;discountAmount;surcharge;discountAfterTax;currencySymbol;salesOrder;discounts=[];taxes;selectedTax;userRole;tabActive;isEditOrder;isPreferedPayment;customerPoint;customer;tabLoyaltyTitle;pointUsed;availablePoint;initAvailablePoint(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed;this.customerPoint=t,this.availablePoint=(t||0)-(e||0)}initTabLoyaltyTitle(){let e=this.pageInitialService?.Data?.AppConfigJSON?.ApplicationLoyalty?.Label;this.tabLoyaltyTitle=S.IsNotEmpty(e)?e:"Loyalty"}initDiscountAndTax(){this.discount1=this.salesOrder.Order.Discount,this.discount2=this.salesOrder.Order.Discount2,this.discountAmount=this.salesOrder.Order.DiscountAmount,this.surcharge=this.salesOrder.Invoice.SurchargePcg,this.discountAfterTax=this.invoiceCalculatorService.discountAfterTax,this.currencySymbol=this.invoiceCalculatorService.currencySymbol,this.taxes=this.pageInitialService.Data.Taxes,this.selectedTax=this.invoiceCalculatorService.tax,this.pointUsed=this.salesOrder.Order.PointUsed}updateTax(t){this.selectedTax=t}onOk(){this.resetAppliedCoupon(),this.applyChangesDiscountAmount(),this.salesOrder.Order.Discount=this.discount1,this.salesOrder.Order.Discount2=this.discount2,this.salesOrder.Invoice.SurchargePcg=this.surcharge,this.salesOrder.Invoice.TempSurchargePcg=this.surcharge,this.invoiceCalculatorService.discountAfterTax=this.discountAfterTax,this.salesOrder.Order.TaxTypeID=this.selectedTax.ID,this.invoiceCalculatorService.tax=this.selectedTax,this.orderService.pushNewValue(this.salesOrder),this.onClose()}onClose(){this.dialogRef.close()}calculateDiscountCalculator(){var t=100;this.discounts.forEach(e=>{t=t*(100-e)/100}),this.discount1=100-t}onDiscountAfterTaxChange(){this.discountAmount=this.discountAfterTax;let e=this.invoiceCalculatorService.TotalBeforeTax-this.discountAmount,i=this.orderService.Data.Order.TaxTypeID,n=this.pageInitialService.Data.Taxes,l=S.FilterByID(n,i);if(S.IsNotEmpty(l)&&l.CalculationTypeID==0){let C=1+l.Rate/100,R=e*C;this.discountAmount=(R-(R-this.discountAfterTax))/C}}applyChangesDiscountAmount(){let t=this.salesOrder.Order.DiscountAmount;this.discountAmount!=t&&(this.salesOrder.Order.DiscountAmount=this.discountAmount)}onTabChange(t){this.tabActive=t}resetAppliedCoupon(){let t=this.promotionCouponService.coupon,e=this.salesOrder.Order.DiscountAmount;t&&t.Requirement?.Type==2&&e!=this.discountAmount&&(this.salesOrder.Order.PromotionCoupon=null,this.salesOrder.Order.PromotionNote=null)}onShowModalRedeem(){this.onClose(),this.dialog.open(ni)}static \u0275fac=function(e){return new(e||o)(m(j),m(N),m(Pe),m(A),m(me),m(pt),m(q),m($t),m(ne),m(Ve))};static \u0275cmp=M({type:o,selectors:[["POS-modal-discount"]],decls:8,vars:4,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],[3,"onTabChange"],[4,"ngIf"],["tabTitle","Discount",3,"active"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-3"],[1,"fw-bold","d-block"],[1,"col-9"],["type","text","data-cy","discount1","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"ms-1"],[1,"mx-2"],["type","text","data-cy","discount2","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],[1,"col-9","d-flex","align-items-center"],["type","text","data-cy","discountamount","autoNum","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","disabled","ngModel"],["role","button",3,"click"],[1,"fa-solid","fa-info-circle","ms-2"],["matTooltipPosition","above","tabTitle","Tax"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","select-tax",2,"width","150px",3,"change","clearable","ngModel","items"],["type","text","data-cy","surcharge","autoNum","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","85px",3,"ngModelChange","ngModel","max","min"],["tabTitle","Calculator"],[1,"col-4"],[1,"col-8","ps-6"],["type","text","num-neg","false","autoNum","","emptyInputBehavior","zero",1,"txtPrice","form-control",2,"width","100px",3,"ngModelChange","ngModel"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal2","autoNum","","decimalPlaces","2","percentage","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),f("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),p(1,' "> '),r(2,"content")(3,"div",1)(4,"custom-tabs",2),f("onTabChange",function(l){return i.onTabChange(l)}),_(5,nl,22,7,"ng-container",3)(6,ol,16,6,"ng-container",3)(7,rl,26,4,"ng-container",3),a()()()()),e&2&&(c("config",i.modalConfig),s(5),c("ngIf",i.userRole.Discount),s(),c("ngIf",i.userRole.Tax),s(),c("ngIf",i.userRole.Discount))},dependencies:[te,U,X,xe,Z,K,ie,Ji,Qr,Wr,Qe,Q,et,ut,st,Ke],encapsulation:2})};var dn=class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=bt({type:o});static \u0275inj=Ct({imports:[te,xe]})};var mn=class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=bt({type:o});static \u0275inj=Ct({imports:[te,xe,ze,Qe,Pi,et,Br,ut,Ji,Ke,sn,Sr,pr,Ii,ut,Ft,qr,Go,wi,dn,Jr,Pt,Ri,zr,Gi,et,oi,zi,Di]})};var un=class o{constructor(t,e,i,n,l,C,R){this.orderProcessorService=t;this.posDataService=e;this.signalBroadCast=i;this.calculatorService=n;this.OrderHttpService=l;this.localDataService=C;this.posService=R;this.newSale=new He}newSale;retrySubmit(){let t=this.posService.Data.AppConfigJSON,e=this.posDataService.Data;this.posDataService.submitOrder(t).then(i=>{i.Success?(this.broadcastToCustomerDisplay(i),this.posDataService.pushNewValue(e),this.orderProcessorService.updatePosState(1,i)):(this.posDataService.pushNewValue(e),this.orderProcessorService.updatePosState(1,i))}).catch(i=>{console.log(i)})}broadcastToCustomerDisplay(t){let i=this.posDataService.Data.TotalPaidAmount-this.calculatorService.Data;this.signalBroadCast.BroadcastStateToCustomerDisplay(1,t.ObjectID,t.LoyaltyPoint,i).subscribe()}saveOffline(){let t=this.posDataService.Data,e=this.OrderHttpService.generatePOSDataForSubmission(t,!1);this.localDataService.syncOrder(e).subscribe(()=>{this.newSale.next()})}static \u0275fac=function(e){return new(e||o)(m(q),m(N),m(Mt),m(Pe),m(he),m(Ie),m(A))};static \u0275cmp=M({type:o,selectors:[["app-retry"]],outputs:{newSale:"newSale"},decls:21,vars:0,consts:[[1,"card"],[1,"card-header","bg-gradient-danger"],[1,"d-flex","justify-content-between"],[1,"fa-solid","fa-times-circle","me-1","text-danger"],[1,"card-body"],[1,"row","justify-content-center","g-0","mt-8"],[1,"col-8","text-center"],[1,"text-danger","fs-5"],[1,"row","mt-4","justify-content-center","g-0","mb-9"],[1,"col-5","text-center"],["type","button","matTooltipPosition","above","matTooltip","Upload your local / offline order to the cloud",1,"btn","btn-success","btn-lg","fs-3",3,"click"],[1,"card-footer","bg-light-gray"],[1,"row","justify-content-between","py-6"],[1,"col-auto"],["type","button","matTooltipPosition","above","matTooltip","Temporarily save data locally until connection to the server is restored",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-save","me-2",2,"font-size","14px"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),b(4,"i",3),p(5," Order Upload Fail! "),a()()(),r(6,"div",4)(7,"div",5)(8,"div",6)(9,"p",7),p(10," Slow Connection Detected, Check the customer invoice list first. If the transaction isn't there, click the 'Retry' button. "),a()()(),r(11,"div",8)(12,"div",9)(13,"button",10),f("click",function(){return i.retrySubmit()}),p(14," Retry Upload "),a()()()(),r(15,"div",11)(16,"div",12)(17,"div",13)(18,"button",14),f("click",function(){return i.saveOffline()}),b(19,"i",15),p(20,"Save Offline "),a()()()()())},dependencies:[te,Ke,de],encapsulation:2})};var ra=(()=>{class o{constructor(){this.emailRegex=S.emailRegex,this.phoneNumberRegex=S.phoneNumberRegex}validate(e){let i=this.emailRegex,n=this.phoneNumberRegex,l=i.test(e.value),C=n.test(e.value);if(l||C||e.value=="")return null;{let R="Please input a valid email or phone number";return C?R="Please input a valid email":l&&(R="Please input a valid phone number"),{invalidEmailOrPhoneNumber:{value:e.value,errMessage:R}}}}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275dir=vi({type:o,selectors:[["","pOSIsInvalidEmailOrPhoneNumber",""]],features:[at([{provide:Vo,useExisting:o,multi:!0}])]})}}return o})();function al(o,t){o&1&&(O(0),r(1,"div",3)(2,"h4",4),p(3," For use this feature you must register first!"),b(4,"br"),p(5," Click the link below "),a()(),r(6,"a",5),p(7,"more information"),a(),p(8," > "),x())}function ll(o,t){if(o&1){let e=v();r(0,"div",6)(1,"div",7)(2,"span",8),b(3,"i",9),a(),b(4,"input",10),r(5,"button",11),p(6,"Copy to Clipboard"),a()()(),r(7,"div",12)(8,"div",13)(9,"span",14),b(10,"i",15),a(),b(11,"input",16),r(12,"button",17),f("click",function(){u(e);let n=d();return g(n.onSendViaWhatsApp())}),p(13,"Send via WhatsApp"),a()()()}if(o&2){let e=d();s(4),c("value",e.data.link),s(),c("cdkCopyToClipboard",e.data.link),s(6),c("formControl",e.whatsAppNumberCtrl),s(),c("disabled",e.whatsAppNumberCtrl.invalid)}}var _i=class o{constructor(t,e,i){this._dialogRef=t;this._toast=e;this.data=i}modalConfig=new W;whatsAppNumberCtrl;ngOnInit(){this.modalConfig.title="Midtrans Payment Link",this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="500px",this.initWaNumberCtrl()}initWaNumberCtrl(){this.whatsAppNumberCtrl=new Bo(null,[pi.pattern("^[0-9]*$"),pi.required])}close(){this._dialogRef.close()}onSendViaWhatsApp(){let t=this.whatsAppNumberCtrl.value;if(t){let e="https://wa.me/"+t+"?text="+this.data.link;window.open(e,"_blank")}else this._toast.error("Phone Number must be insert")}static \u0275fac=function(e){return new(e||o)(m(j),m(z),m(Ve))};static \u0275cmp=M({type:o,selectors:[["POS-modal-generate-link"]],standalone:!1,decls:5,vars:3,consts:[["hasLink",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-2",2,"width","350px"],[1,"fw-normal","d-block"],["href","https://midtrans.com/id/product/payment-link","target","_blank"],[1,"col-sm-12"],[1,"input-group"],["id","inputGroup-sizing-lg p-6",1,"input-group-text"],[1,"fa-solid","fa-link","fs-5"],["readonly","","type","text","aria-label","Link href",1,"form-control",3,"value"],["id","btnCopyLink","type","button",1,"btn","btn-outline-secondary",2,"width","150px",3,"cdkCopyToClipboard"],[1,"col-sm-12","mt-6"],[1,"input-group",2,"width","29.4rem"],["id","inputGroup-sizing-lg",1,"input-group-text","p-7"],[1,"fa-solid","fa-mobile-screen-button","fs-3"],["type","text","placeholder","Mobile Number (e.g. 6281500000000)","aria-label","Mobile Number (e.g. 6281500000000)",1,"form-control",3,"formControl"],["id","btnSend","type","button",1,"btn","btn-outline-secondary",3,"click","disabled"]],template:function(e,i){if(e&1){let n=v();r(0,"modal-material",1),f("onOk",function(){return u(n),g(i.close())})("onCancel",function(){return u(n),g(i.close())})("onClose",function(){return u(n),g(i.close())}),r(1,"content"),_(2,al,9,0,"ng-container",2)(3,ll,14,4,"ng-template",null,0,H),a()()}if(e&2){let n=F(4);c("config",i.modalConfig),s(2),c("ngIf",i.data.link==null||i.data.link=="")("ngIfElse",n)}},dependencies:[U,Z,K,Ot,Q,Gr],encapsulation:2})};var pl=o=>({"rounded-0 rounded-start-2":o}),dl=(o,t)=>({"bg-gradient-warning":o,"bg-gradient-danger":t}),ml=o=>({offline:o}),ul=o=>({"ms-2":o}),gl=(o,t)=>({ID:o,Template:t}),fl=(o,t,e)=>({InvoiceID:o,OutID:t,Template:e}),_l=o=>({ID:o,Print:1,Printer:"Normal"}),Cl=o=>({ID:o});function bl(o,t){if(o&1&&(r(0,"a",47),p(1,"Delivery Order"),a()),o&2){let e=d(3);c("queryParams",ye(1,gl,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function hl(o,t){if(o&1&&(r(0,"a",48),p(1,"Invoice & Delivery Order"),a()),o&2){let e=d(3);c("queryParams",Io(1,fl,e.completeData.ObjectID,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function vl(o,t){if(o&1&&(r(0,"a",49),p(1,"Invoice (No Price)"),a()),o&2){let e=d(3);c("href",e.getInvoicePrintURL(!0),Ye)}}function Sl(o,t){if(o&1&&(r(0,"a",50),p(1,"Packing Slip"),a()),o&2){let e=d(3);c("queryParams",E(1,_l,e.completeData.OutDeliveryID))}}function yl(o,t){if(o&1&&(r(0,"div",30),b(1,"button",41),r(2,"div",42),_(3,bl,2,4,"a",43)(4,hl,2,5,"a",44)(5,vl,2,1,"a",45)(6,Sl,2,3,"a",46),a()()),o&2){let e=d(2);s(3),c("ngIf",e.completeData.OutDeliveryID),s(),c("ngIf",e.completeData.OutDeliveryID),s(),c("ngIf",e.completeData),s(),c("ngIf",e.completeData.OutDeliveryID)}}function Ol(o,t){o&1&&(r(0,"div",32)(1,"div",36)(2,"p",51),p(3," Transaction saved to your browser's local storage. Please upload when connection is restored! "),a()()())}function xl(o,t){if(o&1){let e=v();r(0,"div",33)(1,"div",52)(2,"div",53),f("click",function(){u(e);let n=d(2);return g(n.changeReceiptContact())}),b(3,"i"),a(),r(4,"input",54),f("ngModelChange",function(n){u(e);let l=d(2);return g(l.isPhoneOrEmail(n))}),a()(),r(5,"div",55)(6,"button",56),f("click",function(){u(e);let n=d(2);return g(n.sendReceiptToContact())}),p(7," Send Receipt "),a()()()}if(o&2){let e=d(2);s(3),Ze(e.receiptIcon+" fs-4"),s(),c("formControl",e.customerContact),s(2),c("disabled",e.customerContact.invalid)}}function Il(o,t){if(o&1&&(r(0,"small",34),p(1),a()),o&2){let e=d(2);s(),y(" ",e.customerContact.errors==null||e.customerContact.errors.invalidEmailOrPhoneNumber==null?null:e.customerContact.errors.invalidEmailOrPhoneNumber.errMessage," ")}}function Pl(o,t){if(o&1){let e=v();r(0,"button",57),f("click",function(){u(e);let n=d(2);return g(n.onRetry())}),p(1," Retry Upload "),a()}}function Ml(o,t){if(o&1){let e=v();r(0,"div",60)(1,"button",61),f("click",function(){u(e);let n=d(3);return g(n.generateLink())}),b(2,"i",62),p(3,"Generate Payment Link "),a()()}}function Dl(o,t){if(o&1){let e=v();r(0,"div",60)(1,"button",63),f("click",function(){u(e);let n=d(3);return g(n.verifyPaymentSettlement())}),b(2,"i",64),p(3,"Verify Payment Settlement "),a()()}}function wl(o,t){if(o&1&&(r(0,"div",40)(1,"div",58),_(2,Ml,4,0,"div",59)(3,Dl,4,0,"div",59),a()()),o&2){let e=d(2);s(2),c("ngIf",e.completeData.PaymentStateID==1),s(),c("ngIf",e.isNotEmpty(e.paymentGatewayService.getTransactionId()))}}function kl(o,t){if(o&1){let e=v();r(0,"div",9)(1,"div",26)(2,"div",27)(3,"h2"),b(4,"i",28),p(5," Sell Complete "),r(6,"small",29),p(7),a()(),r(8,"div"),_(9,yl,7,4,"div",30),a()()(),r(10,"div",14)(11,"div",31),_(12,Ol,4,0,"div",32)(13,xl,8,5,"div",33)(14,Il,2,1,"small",34),r(15,"div",35)(16,"div",36)(17,"div",37),_(18,Pl,2,0,"button",38),r(19,"button",39),f("click",function(){u(e);let n=d();return g(n.newSale())}),p(20," New Sale (F8) "),a()()()()()(),_(21,wl,4,2,"div",40),a()}if(o&2){let e=d();s(),c("ngClass",ye(9,dl,(!e.isOrderDateNow||e.completeData.PaymentStateID<3)&&e.completeData.PaymentStateLabel!="Offline",e.completeData.PaymentStateLabel=="Offline")),s(6),y(" (",e.completeData.PaymentStateLabel,")"),s(2),B(e.completeData.PaymentStateLabel=="Offline"?9:-1),s(2),c("ngClass",E(12,ml,e.completeData.PaymentStateLabel=="Offline")),s(),B(e.completeData.PaymentStateLabel=="Offline"?12:13),s(2),B(e.customerContact!=null&&e.customerContact.invalid&&(e.customerContact!=null&&e.customerContact.dirty||e.customerContact!=null&&e.customerContact.touched)?14:-1),s(4),B(e.completeData.PaymentStateLabel=="Offline"&&!e.isSuccessRetrySubmit()?18:-1),s(),c("ngClass",E(14,ul,e.completeData.PaymentStateLabel=="Offline")),s(2),B(e.isOnline&&(e.completeData==null?null:e.completeData.PaymentStateID)==1||e.isNotEmpty(e.paymentGatewayService.getTransactionId())?21:-1)}}function Tl(o,t){if(o&1){let e=v();r(0,"app-retry",65),f("newSale",function(){u(e);let n=d();return g(n.newSale())}),a()}}function El(o,t){if(o&1&&(O(0),r(1,"a",66),p(2),a(),x()),o&2){let e=d();s(),c("queryParams",E(2,Cl,e.completeData.ObjectID)),s(),y(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function Rl(o,t){if(o&1&&(r(0,"span",67),p(1),a()),o&2){let e=d();s(),y(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function Nl(o,t){if(o&1&&(O(0),p(1),h(2,"number"),x()),o&2){let e=d().$implicit;s(),Ue(" ",e.CurrencySymbol," ",I(2,2,e.Amount)," ")}}function Vl(o,t){o&1&&p(0," - ")}function Al(o,t){if(o&1&&(r(0,"div",69)(1,"div",70),p(2),a(),r(3,"div",71),_(4,Nl,3,4,"ng-container",13)(5,Vl,1,0,"ng-template",null,1,H),a()()),o&2){let e=t.$implicit,i=F(6),n=d(2);s(2),T(e.Label),s(2),c("ngIf",n.role.PriceVisible)("ngIfElse",i)}}function Ll(o,t){if(o&1&&(r(0,"div",14),_(1,Al,7,3,"div",68),a()),o&2){let e=d();s(),c("ngForOf",e.itemSummary)}}function Bl(o,t){if(o&1&&(r(0,"div",75)(1,"div",76),p(2),a(),r(3,"div",77),p(4),h(5,"number"),a()()),o&2){let e=t.$implicit,i=t.index,n=d(2);s(),c("hidden",!n.role.PriceVisible),s(),Ue(" ",e.Label,": ",e.CurrencySymbol," "),s(),c("hidden",!n.role.PriceVisible)("ngClass",i+1===n.amountSummary.length?"amount":""),s(),y(" ",I(5,6,e.Amount)," ")}}function Fl(o,t){if(o&1&&(r(0,"div",75)(1,"div",76),p(2),a(),r(3,"div",79),p(4),h(5,"number"),a()()),o&2){let e=t.$implicit,i=d(3);s(),c("hidden",!i.role.PriceVisible),s(),Ue(" ",e.Label,": ",e.CurrencySymbol," "),s(),c("hidden",!i.role.PriceVisible),s(),y(" ",I(5,5,e.Amount)," ")}}function jl(o,t){if(o&1&&(O(0),r(1,"div",78),_(2,Fl,6,7,"div",73),a(),x()),o&2){let e=d(2);s(2),c("ngForOf",e.paymentSummary)}}function Hl(o,t){if(o&1&&(r(0,"div",72),_(1,Bl,6,8,"div",73)(2,jl,3,1,"ng-container",74),a()),o&2){let e=d();s(),c("ngForOf",e.amountSummary),s(),c("ngIf",(e.paymentSummary==null?null:e.paymentSummary.length)>0)}}function Ul(o,t){if(o&1&&(r(0,"div",16)(1,"div",80)(2,"p",81),p(3,"INVALID AMOUNT CHARGE, CORRECT AMOUNT"),a(),r(4,"P",82),p(5),h(6,"number"),a()()()),o&2){let e=d();s(5),y("",I(6,1,e.completeData==null?null:e.completeData.Final)," ")}}function Wl(o,t){if(o&1&&(r(0,"a",22),b(1,"i",83),a()),o&2){let e=d();c("href",e.getInvoicePrintURL(!1),Ye)}}function Ql(o,t){if(o&1&&(r(0,"div",9)(1,"div",11)(2,"h3",12),p(3,"Point Balance"),a()(),b(4,"div",84),a()),o&2){let e=d();s(4),c("innerHtml",e.completeData.LoyaltyPoint,Bt)}}function ql(o,t){if(o&1&&b(0,"pos-receipt",85),o&2){let e=d(2);c("data",e.receiptTemplate)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletRegister)("isUnknownError",e.currentSellState==e.sellState.UploadOrderFail)("isOffline",e.isOnline==!1)("stylesheet",e.posStorage.StylesSheet)}}function $l(o,t){if(o&1&&b(0,"pos-receipt-a4",86),o&2){let e=d(3);c("data",t)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("workOrderMode",!1)("stylesheet",e.posStorage.StylesSheet)}}function Jl(o,t){if(o&1&&(_(0,$l,1,5,"pos-receipt-a4",86),h(1,"async")),o&2){let e,i=d(2);B((e=I(1,1,i.receiptTemplateA4$))?0:-1,e)}}function Gl(o,t){if(o&1&&_(0,ql,1,8,"pos-receipt",85)(1,Jl,2,3),o&2){let e=d();B(e.receiptTemplate&&e.printMode==2?0:-1),s(),B(e.printMode==1?1:-1)}}function zl(o,t){o&1&&(r(0,"div",25)(1,"h1"),p(2," Cannot generate print preview because of client-server amount Mismatch "),a()())}var gn=class o{constructor(t,e,i,n,l,C,R,oe,Ce,dt,ot,je,mt,_t,po,bi,Oa,mo,uo){this._posDataService=t;this._posService=e;this._orderProcessorService=i;this._OrderHttpService=n;this._PaymentHttpService=l;this._receiptService=C;this._outletService=R;this._toastr=oe;this._onlineStatusService=Ce;this._matDialog=dt;this._signalBroadCast=ot;this._calculatorService=je;this._userRoleService=mt;this._router=_t;this._receiptCalculatorService=po;this.datePipe=bi;this.decimalPipe=Oa;this.paymentGatewayService=mo;this.paymentHttpService=uo}whatsappSendReceiptService=pe(Zn);copyToClipBoard=pe(Yr);handleF8(){this.newSale()}salesOrder=new ct;receiptTemplate=null;receiptTemplateA4$;completeData=new gr;printMode=2;outletRegister=new Ni;role;finalAmountDifferent=!1;amountSummary=[];itemSummary=[];paymentSummary=[];isOnline=!1;destroy$=new $;get posStorage(){return this._posService.Data}currentSellState;isOrderDateNow;sellState=be;receiptIcon="fa-brands fa-whatsapp";customerContact=new yt;printOnPayment=ce(!0);isSuccessRetrySubmit=ce(!1);ngOnInit(){this.resetUrlAfterRedirect(),this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._onlineStatusService.getOnlineStatus$().pipe(P(this.destroy$)).subscribe(t=>{this.isOnline=t}),this._userRoleService.Data$.pipe(P(this.destroy$)).subscribe(t=>{this.role=t}),this._posDataService.Data$.pipe(P(this.destroy$)).subscribe(t=>{this.salesOrder=t}),this._outletService.Data$.pipe(P(this.destroy$)).subscribe(t=>{this.outletRegister=t;let e=this.outletRegister?.PrintTemplate?.PrintMode;this.initPrintMode(e)}),this._orderProcessorService.Data$.pipe(se(t=>t.posState===1||t.posState===9),P(this.destroy$)).subscribe(t=>{if(this.currentSellState=t.posState,this.generateCompleteSummary(),this._OrderHttpService.Data){let e=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.PrintOnPayment;this.printOnPayment.set(e),this.completeData=this._OrderHttpService.Data,this.checkFinalAmountDifferent(),this.setLoyaltyLabelConfig(),this.InitPrintInvoice(),this.initCustomerContact(),this.sendEmailOnComplete(),this.checkOrderDateIsNow()}})}generateCompleteSummary(){this.itemSummary=this._receiptService.generateCartItemSummary(),this.amountSummary=this._receiptCalculatorService.generateAmountSummary(),this.paymentSummary=this._receiptService.generatePaymentSummary()}initPrintMode(t){this.isOnline?this.printMode=t:this.printMode=2}sendEmailOnComplete(){let t=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.EmailReceipt,e=this.completeData?.Contact?.Email;t&&S.IsNotEmpty(e)&&this.sendEmail()}resetUrlAfterRedirect(){this._router.events.pipe(P(this.destroy$)).subscribe(t=>{t instanceof To&&(t?.url?.includes("Sell")||(this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(0).subscribe()))})}InitPrintInvoice(){this.currentSellState==1&&(this.checkOrderNumber(),this.print())}initCustomerContact(){if(this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.DefaultReceiptChannel==0){this.receiptIcon="fa-solid fa-envelope";let t=this.completeData?.Contact?.Email;this.customerContact.setValue(t)}else if(this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.DefaultReceiptChannel==1){this.receiptIcon="fa-brands fa-whatsapp";let t=this.completeData?.Contact?.Mobile;this.customerContact.setValue(t)}}isPhoneOrEmail(t){let e=S.emailRegex,i=S.phoneNumberRegex,n=e,l=i,C=n.test(t),R=l.test(t);if(C)return this.receiptIcon="fa-solid fa-envelope","Email";if(R)return this.receiptIcon="fa-brands fa-whatsapp","Mobile"}changeReceiptContact(){this.receiptIcon=="fa-solid fa-envelope"?(this.receiptIcon="fa-brands fa-whatsapp",this.customerContact.setValue(this.completeData?.Contact?.Mobile)):(this.receiptIcon="fa-solid fa-envelope",this.customerContact.setValue(this.completeData?.Contact?.Email))}checkOrderDateIsNow(){let t=this.completeData.OrderTimeString,e=this.datePipe.transform(this.salesOrder.Order.Date,"dd MMM yyyy");this.isOrderDateNow=t.includes(e)}checkFinalAmountDifferent(){if(this.currentSellState==1){let t=this.posStorage.AppConfigJSON,e=this.completeData.Final,i=this._calculatorService.Data,n=t.ModuleSell.ToleranceAmount,l=e-i;if(l!=n&&l!=0){this.finalAmountDifferent=!0;let C=this.decimalPipe.transform(e);setTimeout(()=>{this._toastr.warning(`Final Amount should be ${C}! Use Print Receipt to print the correct Receipt!`,"Invalid Amount charged",{timeOut:1e4})},500)}else this.finalAmountDifferent=!1}}checkOrderNumber(){this.completeData.InvoiceNumber!=this.salesOrder.Order.Number&&(this._toastr.warning("Your transaction number is changed to "+this.completeData.InvoiceNumber,"Transaction Number Changed!"),this.salesOrder.Order.Number=this.completeData.InvoiceNumber)}generateLink(){this.posStorage.AppConfigJSON.PaymentConfigLink==!0&&this._matDialog.open(_i);let t={InvoiceID:this.completeData.ObjectID};this._PaymentHttpService.generateLink(t).subscribe({next:e=>{this._matDialog.open(_i,{data:{link:e.token.redirect_url}})},error:e=>{this._toastr.error(e.Message,"Couldn't generate link!")}})}newSale(){try{this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(0).subscribe(),this.paymentGatewayService.resetPaymentMethod(),this._router.navigate([],{queryParams:{ID:null}})}catch(t){console.error(t),this._toastr.error(t,"Error redirecting to NEW mode")}}onRetry(){this._onlineStatusService.isOnline?this._posDataService.uploadOfflineOrder().subscribe(e=>{e.Success?(this.isSuccessRetrySubmit.set(!0),this.broadcastToCustomerDisplay(e),this._orderProcessorService.updatePosState(1,e)):this._orderProcessorService.updatePosState(1,e)}):this._toastr.error("Please check your internet connection and try again.","Connection Required")}broadcastToCustomerDisplay(t){let i=this._posDataService.Data.TotalPaidAmount-this._calculatorService.Data;this._signalBroadCast.BroadcastStateToCustomerDisplay(1,t.ObjectID,t.LoyaltyPoint,i).subscribe()}getInvoicePrintURL(t){let e="/print/Invoice"+(this.outletRegister.PrintTemplate.PrintMode===2?"Mini":""),i="";return t&&(i="&Print=1&Price=0"),S.StringFormat("{0}?ID={1}&Template={2}{3}",e,this.completeData.ObjectID,this.outletRegister?.PrintTemplate?.ID?.toString(),i)}sendEmail(){if(!this.role.Email){this._toastr.info("You do not have required Role",Be.Info);return}this._OrderHttpService.sendEmail(this.customerContact.value,this.completeData.ObjectID).then(t=>{this._toastr.success(t.Message,"Email sent!")})}sendReceiptByWhatsaap(){let t=this.customerContact.value;this.whatsappSendReceiptService.createCustomerFromNewNumberAndSendReceipt(t,this._calculatorService.currencySymbol,this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.WhatsappReceipt,{Final:this.completeData.Final,InvoiceNumber:this.completeData.InvoiceNumber,ObjectID:this.completeData.ObjectID},this._posService.Data?.WhatsAppConfigJSON?.TextReceipt)}print(){this.printMode==2?(this.printReceiptMini(),this.printOnPayment()&&this.printWindow()):this.printMode==1&&this.printReceiptA4()}printReceiptMini(){this.receiptTemplate=this._receiptService.generateReceiptMini()}setLoyaltyLabelConfig(){let t=this.posStorage?.AppConfigJSON;t.LoyaltyLabel=t.ApplicationLoyalty.Label,this.posStorage.AppConfigJSON=t}printReceiptA4(){this.receiptTemplateA4$==null?this.receiptTemplateA4$=this._OrderHttpService.generateReceiptA4(this.completeData.ObjectID).pipe(P(this.destroy$),rt(t=>(t.Data.AfterSell=!0,t.Data)),ai(t=>{throw this._toastr.error(`Could not print in A4 format!
@@ -53,4 +53,4 @@ Printing in 8mm format instead!`,"Error!"),this.printReceiptMini(),t}),Ee(()=>{t
53
53
  Please add the tag <a href="/menu/Setup/Tag/Sales_Order">here</a> to continue.
54
54
  </p>
55
55
  `,headerType:Be.Error},width:"28rem"})}initializeRole(){let e=new mr(this.roleService);this.userRoleService.pushNewValue(e)}subscribeToObservable(){this.orderProcessorService.Data$.pipe(P(this.destroy$)).subscribe(e=>{this.currentState=e.posState}),this.signalRClientService.OnPaymentReceived.pipe(P(this.destroy$)).subscribe(e=>{this.onQRPaymentComplete(e)}),this.outletService.Data$.pipe(P(this.destroy$)).subscribe(e=>{this.outletRegister=e,this.onOpenDialogOfflineOrder()}),this.userRoleService.Data$.pipe(P(this.destroy$)).subscribe(e=>{this.userRole=e}),this.parkOrderService.onPrint$.pipe(P(this.destroy$)).subscribe(e=>{switch(this.isPrintBillA4=!1,this.isPrintBillMini=!1,this.isPrintPark=!1,this.receiptTemplate=e.template,e.type){case"BILL_A4":this.isPrintBillA4=!0;break;case"BILL_MINI":this.isPrintBillMini=!0;break;case"PARK":this.isPrintPark=!0;break}this.receiptService.printWindow().finally(()=>{this.receiptTemplate=null})})}onQRPaymentComplete(e){if(!S.IsEmpty(e)){let i=JSON.parse(e);this.paymentServiceGateway.onQRPaymentComplete(i,this.posHttpResponse.AppConfigJSON).then(n=>{this.dialog.getDialogById("ModalPayment").close();let R=`IDR ${this.decimalPipe.transform(i.gross_amount)} received. Please verify in customer mobile app!`;this.toastr.success(R," QR Settlement"),this.paymentServiceGateway.clearTransactionID(),this.orderProcessorService.updatePosState(1,n)}).catch(n=>{this.toastr.error(n.message,n.header?n.header:"Error")})}}editInvoice(e){this.orderProcessorService.updatePosState(2),this.orderHttpService.GetInvoiceBySoID(e).pipe(P(this.destroy$)).subscribe(i=>{this.invoiceNumberEdit=i.Invoice.Number,i.Invoice.Number=null,this.orderProcessorService.plainToClass(i)})}initEcrSignalR(){if(this.ecrSignalRService.isConnected()){let i=this.ecrStorage.ecrUrl();this.ecrSignalRService.initConnection(i)}}ngOnDestroy(){this.intercomService.showLauncher(),this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(i){return new(i||o)(m(Ie),m(A),m(Y),m(Eo),m(Ro),m(q),m(X),m(Fi),m(ne),m(z),m(Se),m(me),m(Dt),m(he),m(Ut),m(jo),m(tr),m(Wt),m(zt),m(Qi),m(ht),m(Ae))};static \u0275cmp=M({type:o,selectors:[["POS-sell-v3"]],features:[at([Se,kt]),Si],decls:9,vars:8,consts:[["COMPLETE",""],[1,"d-block","d-print-none"],[1,"container-fluid","sell-container",3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"print_containers"],[3,"data","printTemplate","config","stylesheet",4,"ngIf"],[3,"data","printTemplate","config","outletInfo","stylesheet",4,"ngIf"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo","stylesheet",4,"ngIf"],["class","row d-print-none",4,"ngIf"],[1,"row","d-print-none"],[1,"col-5","pe-6"],[1,"border-start","ps-6","col-7"],[1,"row"],[1,"col-12","px-0"],[3,"data","printTemplate","config","stylesheet"],[3,"data","printTemplate","config","outletInfo","stylesheet"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo","stylesheet"]],template:function(i,n){if(i&1&&(b(0,"subscription-alert",1),r(1,"div",2),_(2,vm,2,1,"ng-container",3)(3,Sm,3,0,"ng-template",null,0,H),a(),r(5,"div",4),_(6,ym,1,4,"park-order",5)(7,Om,1,5,"POS-bill-receipt-A4",6)(8,xm,1,6,"pos-receipt",7),a()),i&2){let l=F(4);s(),c("ngClass",E(6,bm,n.currentSubsStatus==n.subscriptionStatus.OVERDUE||n.currentSubsStatus==n.subscriptionStatus.SELL_ONLY)),s(),c("ngIf",n.currentState!=n.sellState.IsComplete&&n.currentState!=n.sellState.UploadOrderFail)("ngIfElse",l),s(4),c("ngIf",n.isPrintPark&&n.receiptTemplate),s(),c("ngIf",n.receiptTemplate&&n.isPrintBillA4),s(),c("ngIf",n.receiptTemplate&&n.isPrintBillMini)}},dependencies:[te,J,U,rn,An,Lr,qn,mn,ze,Pt,Wi,Ui,Ki,kr,wr,Dr,Mr,gn,sr,Zr],styles:[`.cart-background{background-color:#fcfdff}.sell-container{margin:0 auto!important;height:100%}.sell-container>.row{height:100%}.sell-container>.row>[class*=col-]{height:100%}.sell-container .quicky{overflow:hidden}.sell-subscription-overdue{height:calc(100vh - 3rem)!important;overflow-y:auto}.print_containers{display:none}@media print{.print_containers{display:block;text-align:left}.sell-subscription-overdue{height:auto!important;overflow-y:visible!important}}
56
- `],encapsulation:2})},J1=[{path:"Offline",loadChildren:()=>import("./chunk-BN6GXFBL.js").then(o=>o.OfflineModule)},{path:"",loadComponent:()=>co}];export{co as SellV3Component,J1 as routes};
56
+ `],encapsulation:2})},J1=[{path:"Offline",loadChildren:()=>import("./chunk-YX4RHND4.js").then(o=>o.OfflineModule)},{path:"",loadComponent:()=>co}];export{co as SellV3Component,J1 as routes};