dealpos 12.2.2 → 12.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[9757],{11989:(Rt,E,c)=>{c.d(E,{AM:()=>p});var i=c(81180);class p{constructor(){(0,i.Z)(this,"ID",void 0),(0,i.Z)(this,"TypeID",void 0),(0,i.Z)(this,"Groups",void 0),(0,i.Z)(this,"Items",void 0)}}},19757:(Rt,E,c)=>{c.r(E),c.d(E,{POSModule:()=>hi});var i=c(81180),p=c(36895),b=c(9116),t=c(94650),v=c(77579),g=c(99865),d=c(82722),Et=c(22863),u=c(67327),z=c(96700),Ft=c(90287),h=c(65412),x=c(67347),Yt=c(89156),j=c(77091),M=c(12227),P=c(10832),J=c(29099),Ht=c(71638),U=c(97185),ct=c(58908),Kt=c(25873),T=c(38933),Lt=c(51161),Bt=c(77814),lt=c(42046),Q=(()=>{return(o=Q||(Q={}))[o.STATUS=0]="STATUS",o[o.CONFIG=1]="CONFIG",Q;var o})(),W=c(13337),I=c(63165),_=c(24006);function $t(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",8)(2,"div",3)(3,"div",9)(4,"div",10),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.updateOnlineStatus(!1))}),t.TgZ(5,"label",11),t._UZ(6,"i",12),t.TgZ(7,"h4",13)(8,"strong"),t._uU(9,"ONLINE"),t.qZA()(),t.TgZ(10,"small",14),t._uU(11," Upload orders in realtime to cloud server "),t.qZA()()(),t.TgZ(12,"div",15),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.updateOnlineStatus(!0))}),t.TgZ(13,"label",16),t._UZ(14,"i",17),t.TgZ(15,"h4",18)(16,"strong"),t._uU(17,"OFFLINE"),t.qZA()(),t.TgZ(18,"small",14),t._uU(19," Save order locally, upload manually when connection is available "),t.qZA()()()()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(5),t.ekj("success",!(e.offlineConfig.orderUsingLocal&&e.offlineConfig.productUsingLocal&&e.offlineConfig.configUsingLocal)),t.xp6(8),t.ekj("offline",e.offlineConfig.orderUsingLocal&&e.offlineConfig.productUsingLocal&&e.offlineConfig.configUsingLocal)}}function Gt(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",8)(2,"div",3)(3,"div",20)(4,"div",21),t._uU(5,"Orders"),t.qZA(),t.TgZ(6,"div",21)(7,"input",22),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.orderUsingLocal=r)}),t.qZA(),t.TgZ(8,"label",23),t._uU(9,"Online"),t.qZA()(),t.TgZ(10,"div",21)(11,"input",22),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.orderUsingLocal=r)}),t.qZA(),t.TgZ(12,"label",23),t._uU(13,"Offline"),t.qZA()()(),t.TgZ(14,"div",20)(15,"div",21),t._uU(16,"Products"),t.qZA(),t.TgZ(17,"div",21)(18,"input",24),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.productUsingLocal=r)}),t.qZA(),t.TgZ(19,"label",23),t._uU(20,"Online"),t.qZA()(),t.TgZ(21,"div",21)(22,"input",24),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.productUsingLocal=r)}),t.qZA(),t.TgZ(23,"label",23),t._uU(24,"Offline"),t.qZA()()(),t.TgZ(25,"div",20)(26,"div",21),t._uU(27,"Start Config"),t.qZA(),t.TgZ(28,"div",21)(29,"input",25),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.configUsingLocal=r)}),t.qZA(),t.TgZ(30,"label",23),t._uU(31,"Online"),t.qZA()(),t.TgZ(32,"div",21)(33,"input",25),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.configUsingLocal=r)}),t.qZA(),t.TgZ(34,"label",23),t._uU(35,"Offline"),t.qZA()()()()(),t.BQk()}if(2&o){const e=t.oxw(2);t.xp6(7),t.Q6J("ngModel",e.offlineConfig.orderUsingLocal)("value",!1),t.xp6(4),t.Q6J("ngModel",e.offlineConfig.orderUsingLocal)("value",!0),t.xp6(7),t.Q6J("ngModel",e.offlineConfig.productUsingLocal)("value",!1),t.xp6(4),t.Q6J("ngModel",e.offlineConfig.productUsingLocal)("value",!0),t.xp6(7),t.Q6J("ngModel",e.offlineConfig.configUsingLocal)("value",!1),t.xp6(4),t.Q6J("ngModel",e.offlineConfig.configUsingLocal)("value",!0)}}function Vt(o,s){if(1&o&&t.YNc(0,Gt,36,12,"ng-container",19),2&o){const e=t.oxw();t.Q6J("ngIf",e.offlineConfig)}}const dt=function(o){return{selected:o}};let zt=(()=>{class o{constructor(e,n,r){(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"dialogRef",void 0),(0,i.Z)(this,"indexDbService",void 0),(0,i.Z)(this,"modalConfig",new lt.O),(0,i.Z)(this,"offlineConfig",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"tabState",Q),(0,i.Z)(this,"currentTabState",Q.STATUS),this._onlineStatusService=e,this.dialogRef=n,this.indexDbService=r,this.modalConfig.title="Working Status",this.destroy$=new v.x,this.modalConfig.customWidth="420px"}ngOnInit(){this._onlineStatusService.offlineConfig$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.offlineConfig=e})}updateOnlineStatus(e){this.offlineConfig.configUsingLocal=e,this.offlineConfig.orderUsingLocal=e,this.offlineConfig.productUsingLocal=e}onCancel(){this.dialogRef.close()}onSave(){this.indexDbService.updateOfflineConfig(this.offlineConfig).pipe((0,d.R)(this.destroy$)).subscribe({next:e=>{this._onlineStatusService.pushNewValue(this.offlineConfig),this.dialogRef.close()},error:e=>{console.error(e,"Error")}})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(J.q),t.Y36(h.so),t.Y36(W.T))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-modal-online-status"]],decls:12,vars:9,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"col-12"],["data-cy","point",1,"btn","btn-link-tab",3,"ngClass","click"],["data-cy","invoice",1,"btn","btn-link-tab",3,"ngClass","click"],[4,"ngIf","ngIfElse"],["CONFIG",""],[1,"row","mt-8"],[1,"row","g-0","text-center"],[1,"col-6","pe-3",3,"click"],[1,"btn","btn-outline-secondary","success"],[1,"fa","fa-wifi"],[1,"pt-5","pb-10"],[1,"h6"],[1,"col-6","ps-3",3,"click"],["for","radOffline",1,"btn","btn-outline-secondary","danger"],[1,"fa","fa-wifi-off"],[1,"pt-3"],[4,"ngIf"],[1,"row"],[1,"col-md-4"],["type","radio","name","order",3,"ngModel","value","ngModelChange"],[1,"fw-bold"],["type","radio","name","product",3,"ngModel","value","ngModelChange"],["type","radio","name","config",3,"ngModel","value","ngModelChange"]],template:function(e,n){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onSave()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"a",4),t.NdJ("click",function(){return n.currentTabState=n.tabState.STATUS}),t._uU(6," Status "),t.qZA(),t.TgZ(7,"a",5),t.NdJ("click",function(){return n.currentTabState=n.tabState.CONFIG}),t._uU(8," Config "),t.qZA()()(),t.YNc(9,$t,20,4,"ng-container",6),t.YNc(10,Vt,1,1,"ng-template",null,7,t.W1O),t.qZA()()()),2&e){const r=t.MAs(11);t.Q6J("config",n.modalConfig),t.xp6(5),t.Q6J("ngClass",t.VKq(5,dt,n.tabState.STATUS==n.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(7,dt,n.tabState.CONFIG==n.currentTabState)),t.xp6(2),t.Q6J("ngIf",n.tabState.STATUS==n.currentTabState)("ngIfElse",r)}},dependencies:[p.mk,p.O5,I.M,_.Fj,_._,_.JJ,_.On],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.success[_ngcontent-%COMP%]{color:#fff;background-color:#89b03e}.offline[_ngcontent-%COMP%]{color:#fff;background-color:#c9302c}.fa-wifi-off[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/v1535431932/POS/Images/Icon/wifi-off.svg);height:30px;width:30px;background-size:30px;background-repeat:no-repeat}#radOffline[_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%] .fa-wifi-off[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/wifi-off-white.svg)}.fa-wifi[_ngcontent-%COMP%]{font-size:30px}"]})),o})();var pt=c(11113),jt=c(79098),Wt=c(92408),Xt=c(43111),X=c(43225),tt=c(3238),ut=c(12693),gt=c(21281);let te=0;const ee=(0,tt.Id)(class{}),mt="mat-badge-content";let ne=(()=>{class o extends ee{get color(){return this._color}set color(e){this._setColor(e),this._color=e}get overlap(){return this._overlap}set overlap(e){this._overlap=(0,gt.Ig)(e)}get content(){return this._content}set content(e){this._updateRenderedContent(e)}get description(){return this._description}set description(e){this._updateHostAriaDescription(e)}get hidden(){return this._hidden}set hidden(e){this._hidden=(0,gt.Ig)(e)}constructor(e,n,r,a,l){super(),this._ngZone=e,this._elementRef=n,this._ariaDescriber=r,this._renderer=a,this._animationMode=l,this._color="primary",this._overlap=!0,this.position="above after",this.size="medium",this._id=te++,this._isInitialized=!1}isAbove(){return-1===this.position.indexOf("below")}isAfter(){return-1===this.position.indexOf("before")}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&this._renderer.destroyNode(this._badgeElement),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_createBadgeElement(){const e=this._renderer.createElement("span"),n="mat-badge-active";return e.setAttribute("id",`mat-badge-content-${this._id}`),e.setAttribute("aria-hidden","true"),e.classList.add(mt),"NoopAnimations"===this._animationMode&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),"function"==typeof requestAnimationFrame&&"NoopAnimations"!==this._animationMode?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(n)})}):e.classList.add(n),e}_updateRenderedContent(e){const n=`${e??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateHostAriaDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),e&&this._ariaDescriber.describe(this._elementRef.nativeElement,e),this._description=e}_setColor(e){const n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),e&&n.add(`mat-badge-${e}`)}_clearExistingBadges(){const e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${mt}`);for(const n of Array.from(e))n!==this._badgeElement&&n.remove()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(t.R0b),t.Y36(t.SBq),t.Y36(ut.$s),t.Y36(t.Qsj),t.Y36(t.QbO,8))},o.\u0275dir=t.lG2({type:o,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(e,n){2&e&&t.ekj("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small","small"===n.size)("mat-badge-medium","medium"===n.size)("mat-badge-large","large"===n.size)("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{disabled:["matBadgeDisabled","disabled"],color:["matBadgeColor","color"],overlap:["matBadgeOverlap","overlap"],position:["matBadgePosition","position"],content:["matBadge","content"],description:["matBadgeDescription","description"],size:["matBadgeSize","size"],hidden:["matBadgeHidden","hidden"]},features:[t.qOj]}),o})(),oe=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[ut.rt,tt.BQ,tt.BQ]}),o})();var D=c(10266);function ie(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openReturnModal())}),t.TgZ(2,"a",9),t._UZ(3,"i",10),t.ALo(4,"async"),t.qZA(),t.TgZ(5,"div",11)(6,"span",12),t._uU(7,"Return"),t.qZA()()()()}if(2&o){const e=t.oxw();t.xp6(3),t.Q6J("matBadgeHidden",t.lcZ(4,1,e.orderProcessorService.Data$).posState!==e.posState.IsReturn)}}function re(o,s){if(1&o&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Oqu(e.totalEligiblePromotion)}}function ae(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openPromotionModal())}),t.TgZ(2,"a",13),t._UZ(3,"i",14),t.qZA(),t.TgZ(4,"div",15)(5,"span",12),t._uU(6,"Promotion"),t.qZA(),t.YNc(7,re,2,1,"span",16),t.qZA()()()}if(2&o){const e=t.oxw();t.xp6(7),t.Q6J("ngIf",0!=e.totalEligiblePromotion)}}function se(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openSerialModal())}),t.TgZ(2,"a",18),t._UZ(3,"i",19),t.qZA(),t.TgZ(4,"div",15)(5,"span",12),t._uU(6,"Scan Serial"),t.qZA()()()()}}function ce(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openCouponCodeModal())}),t.TgZ(2,"a",20),t._UZ(3,"i",21),t.qZA(),t.TgZ(4,"div",15)(5,"span",12),t._uU(6,"Coupon"),t.qZA()()()()}}function le(o,s){if(1&o&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Oqu(e.totalOfflineOrders)}}function de(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openSyncModal())}),t.TgZ(2,"a",22),t._UZ(3,"i",23),t.YNc(4,le,2,1,"span",16),t.qZA(),t.TgZ(5,"div",24)(6,"span",12),t._uU(7,"Sync Order"),t.qZA()()()()}if(2&o){const e=t.oxw();t.xp6(4),t.Q6J("ngIf",0!=e.totalOfflineOrders)}}let pe=(()=>{class o{constructor(e,n,r,a,l,m){(0,i.Z)(this,"_localDataService",void 0),(0,i.Z)(this,"_promotionEventService",void 0),(0,i.Z)(this,"matDialog",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"orderProcessorService",void 0),(0,i.Z)(this,"isOnline",void 0),(0,i.Z)(this,"returnEnabled",!0),(0,i.Z)(this,"totalOfflineOrders",0),(0,i.Z)(this,"totalEligiblePromotion",0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"posState",g.J),this._localDataService=e,this._promotionEventService=n,this.matDialog=r,this._posService=a,this._userRoleService=l,this.orderProcessorService=m,this.destroy$=new v.x}ngOnInit(){this.subscribeToObservable()}subscribeToObservable(){this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.returnEnabled=e.Return}),this._promotionEventService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(()=>{this.totalEligiblePromotion=this._promotionEventService.getTotalEligiblePromotion()}),this._promotionEventService.onClickToastPromo.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.openPromotionModal()}),this._localDataService.findAllOrders().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.totalOfflineOrders=e.length})}openOnlineStatusModal(){this.matDialog.open(zt)}openSyncModal(){this.matDialog.open(Wt.c)}openCouponCodeModal(){this.matDialog.open(Bt.P)}openReturnModal(){this.matDialog.open(jt.F)}openPromotionModal(){this.matDialog.open(pt.t,{id:"promotion-event"})}openSerialModal(){this.matDialog.open(Xt.y)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(W.T),t.Y36(X.D),t.Y36(h.uw),t.Y36(x.W),t.Y36(T.J),t.Y36(M.d))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-header"]],inputs:{isOnline:"isOnline"},decls:15,vars:7,consts:[[1,"d-flex","align-items-center"],[1,"me-6"],["matTooltip","Working Status",1,"btn","btn-gray","fw-normal","p-4",3,"click"],[1,"fa","fa-circle","me-2",3,"ngClass"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle","py-4","ps-3"],[1,"caret"],["aria-labelledby","moreMenu",1,"dropdown-menu",2,"left","87%","top","85%"],[4,"ngIf"],[1,"dropdown-item","cursor-pointer","d-flex","align-items-center",3,"click"],["matTooltip","Return","data-cy","Return",1,"header","align-middle","cursor-pointer"],["aria-hidden","true","matBadgeColor","warn","matBadgeSize","small","matBadge","!",1,"fa","fa-retur","retur-badge",3,"matBadgeHidden"],[1,"ms-2"],[1,"fs-5"],["matTooltip","Promotion",1,"header","align-middle","cursor-pointer","ms-1"],[1,"fas","fa-gift","text-black","fs-1"],[1,"ms-3"],["class","position-absolute badge badge rounded-pill bg-danger",4,"ngIf"],[1,"position-absolute","badge","badge","rounded-pill","bg-danger"],["matTooltip","Scan Serial",1,"header","align-middle","cursor-pointer"],[1,"fa-solid","fa-barcode-read","fs-1","text-black"],["matTooltip","Promotion Coupon",1,"header","align-middle","cursor-pointer"],["data-cy","Coupon","aria-hidden","true",1,"fa","fa-coupon"],["matTooltip","Synchronize",1,"header","align-middle","cursor-pointer","ms-1"],[1,"fas","fa-rotate","text-black","fs-1"],[1,"ms-4"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"a",2),t.NdJ("click",function(){return n.openOnlineStatusModal()}),t._UZ(3,"i",3),t.TgZ(4,"span"),t._uU(5),t.qZA()()(),t.TgZ(6,"div")(7,"button",4),t._UZ(8,"b",5),t.qZA(),t.TgZ(9,"ul",6),t.YNc(10,ie,8,3,"li",7),t.YNc(11,ae,8,1,"li",7),t.YNc(12,se,7,0,"li",7),t.YNc(13,ce,7,0,"li",7),t.YNc(14,de,8,1,"li",7),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngClass",n.isOnline?"text-success":"text-danger"),t.xp6(2),t.Oqu(n.isOnline?"Online":"Offline"),t.xp6(5),t.Q6J("ngIf",n.returnEnabled&&n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline))},dependencies:[p.mk,p.O5,ne,D.gM,p.Ov],styles:[".fa-coupon[_ngcontent-%COMP%]{background-position-y:center;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/coupon.svg);height:26px;width:26px;background-repeat:no-repeat}.fa-retur[_ngcontent-%COMP%]{background-position-y:center;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/return.svg);height:26px;width:26px;background-repeat:no-repeat}.btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}i.retur-badge.mat-badge[_ngcontent-%COMP%] > span.mat-badge-content[_ngcontent-%COMP%]{font-size:10px}"]})),o})();var _t=c(98210),F=c(75033),ue=c(51178),ft=c(59660),Y=c(13421),ht=c(79666),ge=c(70755),Ct=c(39300),me=c(11156),S=c(57372),H=c(54102),bt=c(71965),vt=c(83902),_e=c(23370),fe=c(55593);function he(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"span",23),t._UZ(2,"i",24),t.qZA(),t.TgZ(3,"span",25),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.tabIndexActive=r.availablePoint>0?1:r.tabIndexActive)}),t._uU(4),t.ALo(5,"number"),t.qZA(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(4),t.hij(" ",t.lcZ(5,1,e.pointUsed)," Points redeemed ")}}function Ce(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"tab",27)(1,"div",4)(2,"div",5)(3,"label",6),t._uU(4,"Point Used"),t.qZA()(),t.TgZ(5,"div",7)(6,"input",28),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.pointUsed=r)})("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onInputPoint(r))}),t.qZA(),t.TgZ(7,"span",29),t._uU(8,"of "),t.TgZ(9,"a",30),t._uU(10),t.ALo(11,"number"),t.qZA()()()()()}if(2&o){const e=t.oxw(2);t.Q6J("active",1==e.tabIndexActive&&e.availablePoint>0),t.xp6(6),t.Q6J("disabled",e.isEditOrder)("ngModel",e.pointUsed)("max",e.availablePoint?e.availablePoint:0),t.xp6(3),t.Q6J("href","/menu/Contacts/Loyalty/Current_Point/Point_History?ID="+(null==e.salesOrderData||null==e.salesOrderData.Order?null:e.salesOrderData.Order.CustomerID),t.LSH),t.xp6(1),t.hij(" ",t.lcZ(11,6,e.availablePoint)," Points ")}}function be(o,s){if(1&o&&(t.ynx(0),t.YNc(1,Ce,12,8,"tab",26),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.availablePoint&&e.availablePoint>0)}}function ve(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",4)(2,"div",18)(3,"strong"),t._uU(4,"Discount After Tax"),t.qZA()(),t.TgZ(5,"div",31)(6,"input",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.discountAfterTax=r)})("ngModelChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onDiscountAfterTaxChange())}),t.qZA()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(6),t.Q6J("ngModel",e.discountAfterTax)}}let xt=(()=>{class o{constructor(e,n,r,a,l,m,f,C){(0,i.Z)(this,"_dialogRef",void 0),(0,i.Z)(this,"_orderService",void 0),(0,i.Z)(this,"_invoiceCalculatorService",void 0),(0,i.Z)(this,"_posHttpResponseService",void 0),(0,i.Z)(this,"_customerService",void 0),(0,i.Z)(this,"registerActiveService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"data",void 0),(0,i.Z)(this,"modalConfig",new lt.O),(0,i.Z)(this,"discount1",void 0),(0,i.Z)(this,"discount2",void 0),(0,i.Z)(this,"discountAmount",void 0),(0,i.Z)(this,"surcharge",void 0),(0,i.Z)(this,"discountAfterTax",void 0),(0,i.Z)(this,"currencySymbol",void 0),(0,i.Z)(this,"salesOrderData",void 0),(0,i.Z)(this,"discounts",[]),(0,i.Z)(this,"pointUsed",void 0),(0,i.Z)(this,"availablePoint",void 0),(0,i.Z)(this,"tabIndexActive",null),(0,i.Z)(this,"isEnabledMemberPoint",void 0),(0,i.Z)(this,"isDisabledLoyaltyPoint",void 0),(0,i.Z)(this,"isEditOrder",void 0),(0,i.Z)(this,"currentSelectedTax",void 0),this._dialogRef=e,this._orderService=n,this._invoiceCalculatorService=r,this._posHttpResponseService=a,this._customerService=l,this.registerActiveService=m,this._orderProcessorService=f,this.data=C,this.modalConfig.title="Order Discount",this.modalConfig.customWidth="480px",this.salesOrderData=this._orderService.Data,this.discount1=this.salesOrderData.Order.Discount,this.discount2=this.salesOrderData.Order.Discount2,this.discountAmount=this.salesOrderData.Order.DiscountAmount,this.surcharge=this.salesOrderData.Invoice.SurchargePcg,this.discountAfterTax=this._invoiceCalculatorService.discountAfterTax,this.currencySymbol=this._invoiceCalculatorService.currencySymbol,this.currentSelectedTax=this._invoiceCalculatorService.tax,this.pointUsed=this._orderService.Data.Order.PointUsed,this.tabIndexActive=C?.tabIndexActive,this.isEnabledMemberPoint=this.registerActiveService.Data.MemberPoint,this.isDisabledLoyaltyPoint=this._customerService.Data.LoyaltyDisabled,this.isEditOrder=this._orderProcessorService.Data.posState==g.J.IsEdit,this.initAvailablePoint()}initAvailablePoint(){let e=this._customerService?.Data?.Point,n=this._customerService?.Data?.PointUsed;this.availablePoint=(e||0)-(n||0)}onOk(){this.salesOrderData.Order.Discount=this.discount1,this.salesOrderData.Order.Discount2=this.discount2,this.salesOrderData.Invoice.SurchargePcg=this.surcharge,this.salesOrderData.Invoice.TempSurchargePcg=this.surcharge,this.salesOrderData.Order.DiscountAmount=this.discountAmount,this._invoiceCalculatorService.discountAfterTax=this.discountAfterTax,this._orderService.Data.Order.PointUsed=this.pointUsed,this._orderService.pushNewValue(this.salesOrderData),this.close()}close(){this._dialogRef.close()}onDiscountAfterTaxChange(){this.discountAmount=this.discountAfterTax;let n=this._invoiceCalculatorService.TotalBeforeTax-this.discountAmount,l=u.gT.FilterByID(this._posHttpResponseService.Data.Taxes,this._orderService.Data.Order.TaxTypeID);if(u.gT.IsNotEmpty(l)&&l.CalculationTypeID==me.E.Add){let m=1+l.Rate/100,f=n*m;this.discountAmount=(f-(f-this.discountAfterTax))/m}this._orderService.Data.Order.DiscountAmount=this.discountAmount}calculateDiscountCalculator(){var e=100;this.discounts.forEach(n=>{e=e*(100-n)/100}),this.discount1=100-e,this._orderService.Data.Order.Discount=this.discount1}onInputPoint(e){const a=this._orderService.Data.RedeemableAmount;let l=e,m=this._posHttpResponseService.Data.AppConfigJSON.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,f=e*m;f>a&&(l=Math.ceil(a/m),f=a),this.pointUsed=l,this.discountAmount=f}onTabChange(e){"loyalty"!==e&&(this.tabIndexActive=null)}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(h.so),t.Y36(S.q),t.Y36(H.J),t.Y36(x.W),t.Y36(bt.r),t.Y36(P.o),t.Y36(M.d),t.Y36(h.WI))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["POS-modal-discount"]],decls:54,vars:21,consts:[[3,"config","keydown.F2","onOk","onCancel","onClose"],[1,"container"],[3,"onTabChange"],["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",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],[1,"ms-1"],[1,"mx-2"],["type","text","data-cy","discount2","autoNum","","percentage","","decimalPlaces","2",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],["type","text","data-cy","discountamount","autoNum","",1,"form-control","d-inline-block",2,"width","100px",3,"disabled","ngModel","ngModelChange"],[4,"ngIf"],["type","text","data-cy","surcharge","autoNum","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","max","min","ngModelChange"],["tabTitle","Calculator"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-4"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],["type","text","data-cy","discountCal2","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],["type","text","data-cy","discountCal3","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],[1,"pointer"],[1,"fa-solid","fa-circle-info","ms-2"],[1,"pointer",3,"click"],["tabTitle","Loyalty",3,"active",4,"ngIf"],["tabTitle","Loyalty",3,"active"],["type","text","data-cy","surcharge","autoNum","",1,"form-control","d-inline-block",2,"width","80px",3,"disabled","ngModel","max","ngModelChange"],[1,"ms-3"],["target","_blank",3,"href"],["matTooltip","Calculate discount that needs to be given after tax",1,"col-8","ps-6"],["type","text","num-neg","false","autoNum","",1,"txtPrice","form-control",2,"width","100px",3,"ngModel","ngModelChange"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("keydown.F2",function(){return n.onOk()})("onOk",function(){return n.onOk()})("onCancel",function(){return n.close()})("onClose",function(){return n.close()}),t.TgZ(1,"content")(2,"div",1)(3,"custom-tabs",2),t.NdJ("onTabChange",function(a){return n.onTabChange(a)}),t.TgZ(4,"tab",3)(5,"div",4)(6,"div",5)(7,"label",6),t._uU(8,"Discount %"),t.qZA()(),t.TgZ(9,"div",7)(10,"input",8),t.NdJ("ngModelChange",function(a){return n.discount1=a}),t.qZA(),t.TgZ(11,"span",9),t._uU(12,"%"),t.qZA(),t.TgZ(13,"span",10),t._uU(14,"+"),t.qZA(),t.TgZ(15,"input",11),t.NdJ("ngModelChange",function(a){return n.discount2=a}),t.qZA(),t.TgZ(16,"span",9),t._uU(17,"%"),t.qZA()()(),t.TgZ(18,"div",12)(19,"div",5)(20,"label",6),t._uU(21),t.qZA()(),t.TgZ(22,"div",7)(23,"input",13),t.NdJ("ngModelChange",function(a){return n.discountAmount=a}),t.qZA(),t.YNc(24,he,6,3,"ng-container",14),t.qZA()(),t.TgZ(25,"div",12)(26,"div",5)(27,"label",6),t._uU(28,"Surcharge"),t.qZA()(),t.TgZ(29,"div",7)(30,"input",15),t.NdJ("ngModelChange",function(a){return n.surcharge=a}),t.qZA(),t.TgZ(31,"span",9),t._uU(32,"%"),t.qZA()()()(),t.YNc(33,be,2,1,"ng-container",14),t.TgZ(34,"tab",16),t.YNc(35,ve,7,1,"ng-container",14),t.TgZ(36,"div",17)(37,"div",18)(38,"label",6),t._uU(39,"Discount Calculator"),t.qZA()(),t.TgZ(40,"div",19)(41,"input",20),t.NdJ("ngModelChange",function(a){return n.discounts[0]=a})("ngModelChange",function(){return n.calculateDiscountCalculator()}),t.qZA(),t.TgZ(42,"span"),t._uU(43," %"),t.qZA(),t.TgZ(44,"span",10),t._uU(45,"+"),t.qZA(),t.TgZ(46,"input",21),t.NdJ("ngModelChange",function(a){return n.discounts[1]=a})("ngModelChange",function(){return n.calculateDiscountCalculator()}),t.qZA(),t.TgZ(47,"span"),t._uU(48," %"),t.qZA(),t.TgZ(49,"span",10),t._uU(50,"+"),t.qZA(),t.TgZ(51,"input",22),t.NdJ("ngModelChange",function(a){return n.discounts[2]=a})("ngModelChange",function(){return n.calculateDiscountCalculator()}),t.qZA(),t.TgZ(52,"span"),t._uU(53," %"),t.qZA()()()()()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(4),t.Q6J("active",1!==n.tabIndexActive),t.xp6(6),t.Q6J("ngModel",n.discount1)("preventNegative",!0),t.xp6(5),t.Q6J("ngModel",n.discount2)("preventNegative",!0),t.xp6(6),t.hij("Discount ",n.currencySymbol,""),t.xp6(2),t.Q6J("disabled",n.pointUsed&&n.pointUsed>0)("ngModel",n.discountAmount),t.xp6(1),t.Q6J("ngIf",n.pointUsed&&n.pointUsed>0),t.xp6(6),t.Q6J("ngModel",n.surcharge)("max",100)("min",-100),t.xp6(3),t.Q6J("ngIf",n.isEnabledMemberPoint&&!n.isDisabledLoyaltyPoint),t.xp6(2),t.Q6J("ngIf",null==n.currentSelectedTax?null:n.currentSelectedTax.Rate),t.xp6(6),t.Q6J("ngModel",n.discounts[0])("preventNegative",!0),t.xp6(5),t.Q6J("ngModel",n.discounts[1])("preventNegative",!0),t.xp6(5),t.Q6J("ngModel",n.discounts[2])("preventNegative",!0))},dependencies:[p.O5,_.Fj,_.JJ,_.On,I.M,vt.b,D.gM,_e.x,fe.i,p.JJ]})),o})();var xe=c(65550),K=c(76874),et=c(98085),A=c(58393),nt=c(76359),Pe=c(19835);function Oe(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onShowPointModal())}),t._UZ(1,"i",12),t.qZA()}}function ye(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onShowPointModal())}),t._UZ(1,"h6",14),t.TgZ(2,"span",15),t._uU(3),t.ALo(4,"number"),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("innerHtml",e.getLabelLoyalty(),t.oJD),t.xp6(2),t.Oqu(null!=e.customerData&&e.customerData.Point?t.lcZ(4,2,null==e.customerData?null:e.customerData.Point):0)}}function Me(o,s){if(1&o&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e.customerData?null:e.customerData.Debt)," ")}}function De(o,s){1&o&&(t.TgZ(0,"span"),t._uU(1,"-"),t.qZA())}function Se(o,s){if(1&o&&(t.ynx(0),t.TgZ(1,"span"),t._uU(2),t.ALo(3,"number"),t.qZA(),t.BQk()),2&o){const e=t.oxw();t.xp6(2),t.Oqu(t.lcZ(3,1,null==e.customerData?null:e.customerData.DebtLimit))}}function Ze(o,s){1&o&&(t.TgZ(0,"span"),t._uU(1,"\u221e"),t.qZA())}let Te=(()=>{class o{constructor(){(0,i.Z)(this,"customerData",void 0),(0,i.Z)(this,"enabledPoint",void 0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"showPointModal",new t.vpe)}getLabelLoyalty(){if(null!=this.customerData)return null!=this.customerData.Label?""==this.customerData.Label.trim()?"Loyalty":this.customerData.Label:"Loyalty"}onShowPointModal(){this.enabledPoint&&this.showPointModal.emit()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["customer-info"]],inputs:{customerData:"customerData",enabledPoint:"enabledPoint",role:"role"},outputs:{showPointModal:"showPointModal"},decls:18,vars:6,consts:[[1,"customer-panel","position-absolute"],[1,"row","px-5","customer-info-box","arrow-box-bottom","g-0"],["class","col-auto",3,"click",4,"ngIf"],["class","col-auto ms-3",3,"click",4,"ngIf"],[1,"col-auto","ms-3"],["aria-hidden","true",1,"fa-solid","fa-dollar-sign","fa-fw"],[1,"col-auto"],[4,"ngIf","ngIfElse"],["NotHasRole",""],[1,"ms-1","me-1"],["UNLIMITED",""],[1,"col-auto",3,"click"],["data-cy","loyalty","aria-hidden","true",1,"fa","fa-star","fa-fw"],[1,"col-auto","ms-3",3,"click"],[3,"innerHtml"],[2,"font-size","12px"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1),t.YNc(2,Oe,2,0,"div",2),t.YNc(3,ye,5,4,"div",3),t.TgZ(4,"div",4),t._UZ(5,"i",5),t.qZA(),t.TgZ(6,"div",6)(7,"h6"),t._uU(8,"Debt"),t.qZA(),t.TgZ(9,"span"),t.YNc(10,Me,3,3,"ng-container",7),t.YNc(11,De,2,0,"ng-template",null,8,t.W1O),t.TgZ(13,"span",9),t._uU(14,"/"),t.qZA(),t.YNc(15,Se,4,3,"ng-container",7),t.YNc(16,Ze,2,0,"ng-template",null,10,t.W1O),t.qZA()()()()),2&e){const r=t.MAs(12),a=t.MAs(17);t.xp6(2),t.Q6J("ngIf",n.enabledPoint),t.xp6(1),t.Q6J("ngIf",n.enabledPoint),t.xp6(7),t.Q6J("ngIf",null==n.role?null:n.role.DebtView)("ngIfElse",r),t.xp6(5),t.Q6J("ngIf",(null==n.customerData?null:n.customerData.DebtLimit)>0)("ngIfElse",a)}},dependencies:[p.O5,p.JJ],styles:['.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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.customer-panel[_ngcontent-%COMP%]{top:-60px;z-index:1030;margin:auto;left:-85px}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%]{text-align:left;border:1px solid #bbbbbb;padding:5px;margin-bottom:2px;position:relative;display:flex;left:100px}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:0;font-size:1.25rem;padding-top:4px;color:#337ab7}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%] div.col-3[_ngcontent-%COMP%]{text-align:left;right:8px}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.65625rem;margin-top:4px}.customer-info-box[_ngcontent-%COMP%]{background-color:#ffffe1!important}.customer-info-box[_ngcontent-%COMP%]:after{border-width:6px!important;margin-left:-6px!important;border-top-color:#ffffe1!important}.customer-info-box[_ngcontent-%COMP%]:before{border-width:7px!important;margin-left:-7px!important}.arrow-box-bottom[_ngcontent-%COMP%]{position:relative;background:white;border:2px solid #bbbbbb;border-radius:.25rem}.arrow-box-bottom[_ngcontent-%COMP%]:after, .arrow-box-bottom[_ngcontent-%COMP%]:before{top:100%;left:50%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-bottom[_ngcontent-%COMP%]:after{border-color:#0000;border-top-color:#fff;border-width:5px;margin-left:-5px}.arrow-box-bottom[_ngcontent-%COMP%]:before{border-color:#c2e1f500;border-top-color:#bbb;border-width:8px;margin-left:-8px}']})),o})();var Z=c(93669);const Ie=["ngSelectInfinite"];function ke(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"customer-info",19),t.NdJ("showPointModal",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.cashierShowPointModal())}),t.qZA()}if(2&o){const e=t.oxw(2);t.Q6J("customerData",e.customerData)("role",e.role)("enabledPoint",e.isEnabledLoyaltyPoint)}}function Ae(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",20),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.openCustomerModal())}),t._UZ(1,"i",21),t.qZA()}}function we(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",14),t.YNc(1,ke,1,3,"customer-info",15),t._UZ(2,"i",16),t.TgZ(3,"autocompleteV2",17),t.NdJ("optionSelected",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onSelectCustomer(r))})("onInputChange",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onInputCustomer(r))})("onSelect",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onCustomerSelected(r))})("onInputEnter",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onScanCodeCustomer(r))}),t.qZA(),t.YNc(4,Ae,2,0,"a",18),t.qZA()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.customerData&&((null==e.customerData?null:e.customerData.Point)>=0||(null==e.customerData?null:e.customerData.Debt)>0)&&e.checkCustomerEmpty(e.posData.Order.CustomerID)),t.xp6(2),t.Q6J("inputTextValue",e.posData.ContactName)("inputLock",e.role.CustomerInputLock)("prefixIcon",e.role.CustomerInputLock?"fa-solid fa-text-slash":""),t.xp6(1),t.Q6J("ngIf",e.role.ContactsCreate&&e.customerQuickAddEnabled)}}const Ne=function(o){return{"date-warnings":o}};let Je=(()=>{class o{handleF1(){this.setFocusCustomerInput()}handleF2(){this.setFocusSalesPerson()}get isEditState(){return this.posState===g.J.IsEdit}constructor(e,n,r,a,l,m,f,C,O,y,q,R){(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_CustomerHttpService",void 0),(0,i.Z)(this,"_toastrService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_CoreHttpService",void 0),(0,i.Z)(this,"_invoiceCalculatorService",void 0),(0,i.Z)(this,"_shoppingCartService",void 0),(0,i.Z)(this,"selectedRegister",new _t.t),(0,i.Z)(this,"isOnline",void 0),(0,i.Z)(this,"openModal",void 0),(0,i.Z)(this,"customerQuickAddEnabled",!0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"newDate",new Date),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"selectedCustomerId",void 0),(0,i.Z)(this,"posState",g.J.IsNew),(0,i.Z)(this,"isNotToday",void 0),(0,i.Z)(this,"sales",void 0),(0,i.Z)(this,"SalesPerson",!0),(0,i.Z)(this,"customerData",void 0),(0,i.Z)(this,"appConfig",new Y.A),(0,i.Z)(this,"salesPersonName",""),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"previousCustomerID",void 0),(0,i.Z)(this,"isEnabledLoyaltyPoint",void 0),(0,i.Z)(this,"disabledSalesOption",!1),(0,i.Z)(this,"ngSelectInfinite",void 0),this._onlineStatusService=e,this._outletService=n,this._orderDataService=r,this._posService=a,this._matDialog=l,this._orderProcessorService=m,this._CustomerHttpService=f,this._toastrService=C,this._userRoleService=O,this._CoreHttpService=y,this._invoiceCalculatorService=q,this._shoppingCartService=R,this.destroy$=new v.x}ngOnInit(){this.appConfig=this._posService.Data.AppConfigJSON,this.customerQuickAddEnabled=this.appConfig.ModuleSell.Customer.QuickAddEnabled,this.subscribeToValueChanges()}subscribeToValueChanges(){this.subscribeToCartItemsChange(),this._onlineStatusService.getOnlineStatus$().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.isOnline=e}),this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e,this.checkDisabledSalesOption()}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.customerData=this._CustomerHttpService.Data,this.posState=e.posState,this.initEnableLoyaltyPoint(),e.posState===g.J.isPark&&this.clearContactName()}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.selectedRegister=e,this.sales=e.ListSales,this.initEnableLoyaltyPoint()}),this._orderProcessorService.clearOrder$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{e&&this.clearContactName()})}setFocusCustomerInput(){let e=document.getElementById("ContactID");e&&e.focus()}setFocusSalesPerson(){this.ngSelectInfinite&&this.ngSelectInfinite.ngSelectElement.focus()}checkDisabledSalesOption(){this.disabledSalesOption=!1,this.posData.CartItems.filter(n=>u.gT.IsNotEmpty(n.SalesID)).length>0&&(this.disabledSalesOption=!0)}initEnableLoyaltyPoint(){this.isEnabledLoyaltyPoint=!1,!this.customerData.LoyaltyDisabled&&this.selectedRegister.MemberPoint&&(this.isEnabledLoyaltyPoint=!0)}clearContactName(){this.posData.ContactName=null}subscribeToCartItemsChange(){let e=0;this._orderDataService.Data$.pipe((0,d.R)(this.destroy$),(0,Ct.h)(n=>e!=n.TotalQuantity)).subscribe(n=>{e=n.TotalQuantity,this._orderProcessorService.reedemPointToDiscount()})}openRegisterModal(){this._matDialog.open(ue.d,{id:"registerModal"}).afterClosed().subscribe(n=>{n&&this.openOpeningCashModal()})}openOpeningCashModal(){this.appConfig.ModuleShift.Closure.Enabled&&this.appConfig.ModuleShift.Closure.OpeningCashRequired&&this._matDialog.open(ge.X).afterClosed().subscribe(n=>{n&&null!=n.amount&&(this._CoreHttpService.recordOpeningCash({RegisterID:this.posData.Order.RegisterID,OpAmount:n.amount}),document.getElementById("product").focus())})}openCustomerModal(){this._matDialog.open(ht.A,{autoFocus:!1}).afterClosed().subscribe(e=>{e&&(this._orderProcessorService.pushNewValue(this._orderProcessorService.Data),this.updateDiscountRate(e.DiscountRate))})}cashierShowPointModal(){this._orderProcessorService.Data.posState!=g.J.IsEdit?this._matDialog.open(xt,{data:{tabIndexActive:1}}):this._toastrService.warning("Apply Loyalty Point is not allowed in edit mode","Warning!")}updateSales(){this.salesPersonName=this.sales.filter(e=>e.ID==this.posData.Order.SalesID)[0]?.Name,this._orderDataService.pushNewValue(this.posData)}checkIsNotToday(e){if(e){const n=new Date;n.setHours(0,0,0,0),this.isNotToday=n.getTime()!=e.getTime()}}inputNumberModelChanged(e){this.posData.Order.Number=e}onInputCustomer(e){this._orderProcessorService.Data.InputTextValue=e,null!==e&&0==e.length&&(this.resetCustomerPricebook(),this.posData.Order.PointUsed=0,this.posData.Order.DiscountAmount=0,this.previousCustomerID=JSON.parse(JSON.stringify(this.posData.Order.CustomerID)),this.posData.Order.CustomerID=null,this._CustomerHttpService.Data=new ft.B,this.customerData=new ft.B,this.updateDiscountRate(),this.setFocusCustomerInput())}resetCustomerPricebook(){if(this.customerData){let e=this.customerData.PricebookID;u.gT.IsNotEmpty(e)&&(this.posData.CartItems=this.posData.CartItems.map(r=>(r.PriceBookID==e&&(r.Discount=r.Variant.PriceDiscount,r.Note=r.Variant.PriceNote,r.PriceNote=r.Variant.PriceNote,r.PriceBookID=u.gT.GuidEmpty,r.Price=r.Variant.UnitPrice,r.UnitPrice=r.Variant.UnitPrice),r)))}}onScanCodeCustomer(e){this.clearContactName(),0!==e.length&&this._CustomerHttpService.findCustomerByCode(e).pipe((0,d.R)(this.destroy$)).subscribe(n=>{this.posData.ContactName=n.Display,this.onCustomerSelected(n.ID)})}onCustomerSelected(e){this.previousCustomerID=JSON.parse(JSON.stringify(this.posData.Order.CustomerID)),this.resetCartOnChangeCustomer(e),u.gT.IsNotEmpty(e)&&this._orderDataService.updateCustomerID(e).then(n=>{this.applyCustomerPricebook(n),this.updateTaxCustomer(n.TaxTypeId),u.gT.IsNotEmpty(n.SalesID)&&(this.posData.Order.SalesID=n.SalesID),n.EntityID==u.gT.GuidEmpty?this.customerData=n:n.EntityID!=this.posData.Order.EntityID?(this.posData.Order.CustomerID=null,this.clearContactName(),alert("your customer has a exclusive outlet")):this.customerData=n,null==this.customerData.DiscountRate&&(this.customerData.DiscountRate=0),this.initEnableLoyaltyPoint();const r=this.calculateCustomerDiscount(e);this.updateDiscountRate(r);let a=this.checkResetRedeemPoint();this._orderProcessorService.reedemPointToDiscount(a)})}calculateCustomerDiscount(e){let n=this.customerData.DiscountRate;return u.gT.IsEmpty(this.previousCustomerID)?(n=(n||0)+this.posData.Order.Discount,n>100&&(n=100)):e!==this.previousCustomerID&&(n=n||0),n}checkResetRedeemPoint(){let e=!1;return u.gT.IsNotEmpty(this.previousCustomerID)&&(e=!0),e}applyCustomerPricebook(e){if(u.gT.IsNotEmpty(e.PricebookID)){let n=this.posData.CartItems.map(r=>(r.Variant.PriceBook&&0!==r.Variant.PriceBook.length&&r.Variant.PriceBook.forEach(a=>{a.ID===e.PricebookID&&(r=this._shoppingCartService.applyPricebookToItem(r,a))}),r));this.posData.CartItems=n}}updateDiscountRate(e=0){this.posData.Order.Discount=e,this._orderDataService.pushNewValue()}updateTaxCustomer(e){let r=this._posService.Data.Taxes.find(a=>a.ID==e);r&&(this._orderDataService.Data.Order.TaxTypeID=r.ID,this._invoiceCalculatorService.tax=r,this._orderDataService.pushNewValue())}checkCustomerEmpty(e){let n=u.gT.IsNotEmpty(e);return e&&e.length<u.gT.GuidEmpty.length&&(n=!1),n}resetCartOnChangeCustomer(e){this.selectedCustomerId!=e&&this.appConfig.ModuleSell.Customer.ClearCartOnChange&&(this.posData.CartItems=[],this._orderDataService.pushNewValue(this.posData)),this.selectedCustomerId=e}displayRegisterName(e){let n="Choose an Outlet";const r=this.findOutletRegisterById(e.RegisterID);return null!=r&&null!=r.Name&&(n=r.Name),n}onSelectCustomer(e){const n=JSON.parse(e);this.posData.ContactName=n.Value}findOutletRegisterById(e){return this._posService.Data.Registers.find(a=>a.ID===e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(J.q),t.Y36(P.o),t.Y36(S.q),t.Y36(x.W),t.Y36(h.uw),t.Y36(M.d),t.Y36(bt.r),t.Y36(U._W),t.Y36(T.J),t.Y36(xe.I),t.Y36(H.J),t.Y36(K.F))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-toolbar"]],viewQuery:function(e,n){if(1&e&&t.Gf(Ie,7),2&e){let r;t.iGM(r=t.CRH())&&(n.ngSelectInfinite=r.first)}},hostBindings:function(e,n){1&e&&t.NdJ("keydown.control.F1",function(a){return n.handleF1(a)},!1,t.Jf7)("keydown.control.F2",function(a){return n.handleF2(a)},!1,t.Jf7)},decls:15,vars:18,consts:[[1,"row","header","g-0","py-4"],["data-cy","ChooseRegister",1,"col-auto"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["placeholder","Choose an outlet","readonly","",1,"outlet","cursor","mobile-view",3,"disabled","value","click"],[1,"col-auto","date","mobile-view"],["appearance","fill","data_cy","soDate","name","orderDate",3,"ngClass","disabled","date","dateChange"],[1,"col-auto","number","mobile-view"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Sales order number",1,"fa","fa-hashtag"],["type","text","data-cy","soNumber","required","","placeholder","Number",1,"number",2,"margin-left","3px",3,"ngModel","disabled","ngModelChange"],["class","col-auto customer mobile-view position-relative",4,"ngIf"],[1,"col-auto","d-flex","flex-row","sales","mobile-view"],["aria-hidden","true","matTooltipPosition","above","matTooltip","sales",1,"fa","fa-id-badge","align-middle"],["bindValue","ID","bindLabel","Name","width","185px","position","top","placeholder","Sales Person",1,"sales-person",3,"items","selected","customTooltip","optionTitle","disabled","selectedChange"],["ngSelectInfinite",""],[1,"col-auto","customer","mobile-view","position-relative"],[3,"customerData","role","enabledPoint","showPointModal",4,"ngIf"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Customer",1,"fa","fa-user"],["data_cy","Contact","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Customer","inputID","ContactID","notFoundMessageFor","customer","prefixIconTitle","Customer Input by typing is locked",3,"inputTextValue","inputLock","prefixIcon","optionSelected","onInputChange","onSelect","onInputEnter"],["id","btnCustomer","class","ms-1 pointer","matTooltipPosition","above","matTooltip","New Customer Form",3,"click",4,"ngIf"],[3,"customerData","role","enabledPoint","showPointModal"],["id","btnCustomer","matTooltipPosition","above","matTooltip","New Customer Form",1,"ms-1","pointer",3,"click"],["data-cy","btnCust","aria-hidden","true",1,"fa-solid","fa-circle-plus"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"i",2),t.TgZ(3,"input",3),t.NdJ("click",function(){return n.openRegisterModal()}),t.ALo(4,"limitTo"),t.qZA()(),t.TgZ(5,"div",4)(6,"datepicker",5),t.NdJ("dateChange",function(a){return(null==n.posData?null:n.posData.Order).Date=a})("dateChange",function(a){return n.checkIsNotToday(a)}),t.qZA()(),t.TgZ(7,"div",6),t._UZ(8,"i",7),t.TgZ(9,"input",8),t.NdJ("ngModelChange",function(a){return n.inputNumberModelChanged(a)}),t.qZA()(),t.YNc(10,we,5,5,"div",9),t.TgZ(11,"div",10),t._UZ(12,"i",11),t.TgZ(13,"ng-select-infinite",12,13),t.NdJ("selectedChange",function(a){return(null==n.posData?null:n.posData.Order).SalesID=a})("selectedChange",function(){return n.updateSales()}),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("disabled",n.isEditState)("value",t.xi3(4,13,n.displayRegisterName(n.selectedRegister),20)),t.xp6(3),t.Q6J("ngClass",t.VKq(16,Ne,n.isNotToday))("disabled",!n.role.DateEditor)("date",null==n.posData?null:n.posData.Order.Date),t.xp6(3),t.Q6J("ngModel",null==n.posData?null:n.posData.Order.Number)("disabled",!n.role.NumberEditor),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(3),t.Q6J("items",n.sales)("selected",null==n.posData?null:n.posData.Order.SalesID)("customTooltip",n.salesPersonName)("optionTitle",!0)("disabled",n.disabledSalesOption||!n.role.SalesPerson))},dependencies:[p.mk,p.O5,et.QB,_.Fj,_.JJ,_.Q7,_.On,A.J,nt.R,D.gM,Pe.i,Te,Z.OI],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px,#f9e79f 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.small[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:140px}.small[_ngcontent-%COMP%] .select2-container[_ngcontent-%COMP%]{font-size:12px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:-moz-fit-content;height:fit-content}.col-auto[_ngcontent-%COMP%]:last-child{margin-right:0}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#ffffff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:135px}.col-auto.customer[_ngcontent-%COMP%] autocomplete[_ngcontent-%COMP%] input{font-size:14px}.col-auto.customer[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}.col-auto.sales[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] input{font-size:14px}.col-auto[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%]{width:135px}.header[_ngcontent-%COMP%]{border-bottom:1px solid #dde2eb}.number[_ngcontent-%COMP%], .customer[_ngcontent-%COMP%]{margin-left:9px}.sales[_ngcontent-%COMP%]{margin-left:5px}@media (max-width: 575.98px){.mobile-view[_ngcontent-%COMP%]{margin-top:5px}.mobile-view[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:75%!important}} ng-select-infinite.sales-person ng-select .ng-dropdown-panel.ng-select-bottom{width:20rem!important}"]})),o})();var Ue=c(5607),L=c(53018);function Qe(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",9)(1,"a",10),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openUploadModal())}),t._UZ(2,"i",11),t.qZA()()}}function qe(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",9)(1,"a",12),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openAddItemModal())}),t._UZ(2,"i",13),t.TgZ(3,"small",14),t._uU(4,"(F4)"),t.qZA()()()}}let Re=(()=>{class o{handleF4(){this._matDialog.openDialogs&&this._matDialog.openDialogs.length>0||this.openAddItemModal()}focusProductInput(){this.setFocusToProductInput()}constructor(e,n,r,a,l){(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_cartService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_outletRegisterService",void 0),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"isEdit",!1),(0,i.Z)(this,"Items",void 0),(0,i.Z)(this,"isOnline",!0),(0,i.Z)(this,"AppConfigJSON",new Y.A),(0,i.Z)(this,"renderThumbnail",!1),this._posService=e,this._orderDataService=n,this._cartService=r,this._matDialog=a,this._outletRegisterService=l,this.destroy$=new v.x,this.AppConfigJSON=this._posService.Data.AppConfigJSON,this.renderThumbnail=this.AppConfigJSON.ModuleSell.ProductDialog.ShowThumbnail,this.subscribeToObservable()}ngAfterViewInit(){this.setFocusToProductInput()}subscribeToObservable(){this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e,this.Items=e.CartItems,this.setFocusToProductInput()}),this._outletRegisterService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.setFocusToProductInput()})}setFocusToProductInput(){let e=document.getElementById("product");e&&e.focus()}openUploadModal(){this._matDialog.open(Ue.h)}openAddItemModal(){this._matDialog.open(L.k)}addItem(e){this._cartService.addCartItemById(e).then(()=>{this.openModalItemOnNew(e)})}onBarcodeScan(e){u.gT.IsNotEmpty(e)&&this._cartService.addCartItemByCode(e).then(n=>{this.openModalItemOnNew(n.ID)})}openModalItemOnNew(e){if(this.AppConfigJSON.ModuleSell.ProductDialog.OpenOnNewItemAdded){let n=this.Items.find(a=>a.VariantID==e),r=this.Items.lastIndexOf(n);this._matDialog.open(L.k,{data:{index:r}})}}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(x.W),t.Y36(S.q),t.Y36(K.F),t.Y36(h.uw),t.Y36(P.o))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart-header"]],hostBindings:function(e,n){1&e&&t.NdJ("keydown.F4",function(a){return n.handleF4(a)},!1,t.Jf7)("keydown.control.F3",function(a){return n.focusProductInput(a)},!1,t.Jf7)},decls:14,vars:9,consts:[[1,"row","cart-header","g-0","justify-content-between","align-items-center","p-6"],["matTooltipPosition","above",1,"col-auto",3,"matTooltip"],[1,"fa","fa-shopping-cart","fa-lg","text-success","me-3"],[1,"col-auto"],[1,"input-group","barcode","barcode-input"],[1,"input-group-text","input-group-text"],["aria-hidden","true",1,"fa","fa-barcode"],["data-cy","ProductCart","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search product by name / code","localStorage","products","inputID","product","notFoundMessageFor","product",1,"input-left",3,"clearOnSelect","renderThumbnail","onSelect","onInputEnter"],["class","col-auto add-item",4,"ngIf"],[1,"col-auto","add-item"],["matTooltipPosition","above","matTooltip","Upload Item","data-bs-toggle","modal",1,"pointer","d-block","position-relative","cart-add",3,"click"],["aria-hidden","true",1,"fa","fa-upload","fa-2x","text-success"],["matTooltipPosition","above","matTooltip","Add Item (F4)",1,"pointer","d-block","position-relative","cart-add",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-2x","text-success"],[1,"position-absolute","fst-italic","right-bottom","text-dark"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h5"),t._UZ(3,"i",2),t._uU(4),t.ALo(5,"number"),t.qZA()(),t.TgZ(6,"div",3)(7,"div",4)(8,"div",5)(9,"span"),t._UZ(10,"i",6),t.qZA()(),t.TgZ(11,"autocompleteV2",7),t.NdJ("onSelect",function(a){return n.addItem(a)})("onInputEnter",function(a){return n.onBarcodeScan(a)}),t.qZA()()(),t.YNc(12,Qe,3,0,"div",8),t.YNc(13,qe,5,0,"div",8),t.qZA()),2&e&&(t.xp6(1),t.MGl("matTooltip","You have ",n.posData.cartQuantity," items in current sale"),t.xp6(3),t.AsE(" ",n.isEdit?"Update "+(null==n.posData.Order.ParkLabel?"":n.posData.Order.ParkLabel):"Current Sale "," (",t.lcZ(5,7,n.posData.cartQuantity),") "),t.xp6(7),t.Q6J("clearOnSelect",!0)("renderThumbnail",n.renderThumbnail),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline))},dependencies:[p.O5,A.J,D.gM,p.JJ],styles:["div.row.cart-header{border:solid 1px #cfcfcf;border-bottom:none;border-radius:3px 3px 0 0;background:#f2f7fa;color:#222}div.row.cart-header .right-bottom{font-size:9px;right:-6px;bottom:-10px}.barcode-input{width:305px}.barcode-input>input{height:28px}.barcode-input autocompleteV2{width:267px}autocompleteV2.input-left>mat-form-field>input.form-control{padding-left:0!important;border-left:0!important}\n"],encapsulation:2})),o})();var B=c(41206),w=c(28255),ot=c(96308);const Ee=["cardContainer"];function Fe(o,s){1&o&&t._UZ(0,"th")}function Ye(o,s){1&o&&(t.TgZ(0,"th",20),t._uU(1," Brand "),t.qZA())}function He(o,s){1&o&&(t.TgZ(0,"th",20),t._uU(1," Inv. "),t.qZA())}function Ke(o,s){1&o&&t._UZ(0,"th",21)}function Le(o,s){if(1&o&&(t.TgZ(0,"td")(1,"small"),t._uU(2),t.qZA()()),2&o){const e=t.oxw().index;t.xp6(2),t.hij("",e+1,".")}}function Be(o,s){1&o&&t._UZ(0,"i",42)}function $e(o,s){if(1&o&&(t.TgZ(0,"i",43),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Variant.CategoryName)}}function Ge(o,s){1&o&&(t.ynx(0),t.TgZ(1,"i",46),t._uU(2,"V"),t.qZA(),t.BQk())}function Ve(o,s){1&o&&(t.TgZ(0,"i",47),t._uU(1,"N"),t.qZA())}function ze(o,s){if(1&o&&(t.TgZ(0,"p",44),t.YNc(1,Ge,3,0,"ng-container",30),t.YNc(2,Ve,2,0,"ng-template",null,45,t.W1O),t.qZA()),2&o){const e=t.MAs(3),n=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",n.Taxable)("ngIfElse",e)}}function je(o,s){if(1&o&&(t.ynx(0),t._UZ(1,"p",48),t.BQk()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("innerHtml",e.SerialNote,t.oJD)}}function We(o,s){if(1&o&&t._UZ(0,"p",48),2&o){const e=t.oxw(2).$implicit;t.Q6J("innerHtml",e.Note,t.oJD)}}function Xe(o,s){if(1&o&&t.YNc(0,We,1,1,"p",49),2&o){const e=t.oxw().$implicit;t.Q6J("ngIf",e.Note)}}function tn(o,s){if(1&o&&(t.TgZ(0,"p")(1,"i",50),t._uU(2),t.qZA()()),2&o){const e=t.oxw().$implicit,n=t.oxw();t.xp6(2),t.hij("Fulfillment from: ",n.getOutletName(e.EntityID),"")}}function en(o,s){if(1&o&&(t.TgZ(0,"p",51),t._uU(1," Sold by "),t.TgZ(2,"i"),t._uU(3),t.qZA()()),2&o){const e=t.oxw().$implicit,n=t.oxw();t.xp6(3),t.hij(" ",n.getSalesName(e.SalesID)," ")}}function nn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"td",38),t.NdJ("click",function(){t.CHM(e);const r=t.oxw().index,a=t.oxw();return t.KtG(a.openItemModal(r))}),t._uU(1),t.qZA()}if(2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.Variant.BrandName," ")}}function on(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"td",52),t.NdJ("click",function(){t.CHM(e);const r=t.oxw().index,a=t.oxw();return t.KtG(a.openItemModal(r))}),t.qZA()}if(2&o){const e=t.oxw().$implicit;t.Q6J("innerHtml",e.Variant.UnitsInStock,t.oJD)}}function rn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij("x",e.UnitQuantity,"")}}function an(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij("@",e.VariantUnitQuantity,"")}}function sn(o,s){if(1&o&&(t.TgZ(0,"td")(1,"small"),t._uU(2),t.qZA()()),2&o){const e=t.oxw().$implicit;t.xp6(2),t.Oqu("null"!=e.Variant.UOM?e.Variant.UOMName:"")}}function cn(o,s){1&o&&(t.ynx(0),t._uU(1," - "),t.BQk())}function ln(o,s){if(1&o&&(t.TgZ(0,"div",55),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(3).$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.UnitPriceOriginal,"1.0-4")," ")}}function dn(o,s){if(1&o&&(t.ynx(0),t.YNc(1,ln,3,4,"div",54),t.TgZ(2,"div"),t._uU(3),t.ALo(4,"number"),t.qZA(),t.BQk()),2&o){const e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",e.UnitPriceOriginal>e.Price),t.xp6(2),t.hij(" ",t.xi3(4,2,e.Price,"1.0-4")," ")}}function pn(o,s){if(1&o&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Price,"1.0-4")," ")}}function un(o,s){if(1&o&&(t.YNc(0,dn,5,5,"ng-container",30),t.YNc(1,pn,3,4,"ng-template",null,53,t.W1O)),2&o){const e=t.MAs(2),n=t.oxw(2);t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell||null==n.AppConfigJSON.ModuleSell.Promotion?null:n.AppConfigJSON.ModuleSell.Promotion.StrikethroughOriginalPrice)("ngIfElse",e)}}function gn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"tr",22),t.NdJ("contextmenu",function(r){const a=t.CHM(e),l=a.$implicit,m=a.index,f=t.oxw();return t.KtG(f.onContextMenu(r,l,m))}),t.TgZ(1,"td",23)(2,"input",24),t.NdJ("ngModelChange",function(r){const l=t.CHM(e).$implicit;return t.KtG(l.Splited=r)}),t.qZA(),t.TgZ(3,"i",25),t.NdJ("click",function(){const a=t.CHM(e).$implicit,l=t.oxw();return t.KtG(l.removeItem(a))}),t.qZA()(),t.YNc(4,Le,3,1,"td",5),t.TgZ(5,"td",26),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Quantity"))}),t.TgZ(6,"span"),t._uU(7),t.YNc(8,Be,1,0,"i",27),t.qZA(),t.YNc(9,$e,2,1,"i",28),t.YNc(10,ze,4,2,"p",29),t.YNc(11,je,2,1,"ng-container",30),t.YNc(12,Xe,1,1,"ng-template",null,31,t.W1O),t.YNc(14,tn,3,1,"p",5),t.YNc(15,en,4,1,"p",32),t.qZA(),t.YNc(16,nn,2,1,"td",33),t.YNc(17,on,1,1,"td",34),t.TgZ(18,"td",35),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a))}),t.qZA(),t.TgZ(19,"td",21)(20,"input",36),t.NdJ("ngModelChange",function(r){const l=t.CHM(e).$implicit;return t.KtG(l.SplitQuantity=r)}),t.qZA(),t.TgZ(21,"span",37),t._uU(22,"/"),t.qZA(),t.TgZ(23,"span",38),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Quantity"))}),t._uU(24),t.ALo(25,"number"),t.qZA(),t.YNc(26,rn,2,1,"span",5),t.YNc(27,an,2,1,"span",5),t.qZA(),t.YNc(28,sn,3,1,"td",5),t.TgZ(29,"td",39),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Price"))}),t.YNc(30,cn,2,0,"ng-container",30),t.YNc(31,un,3,2,"ng-template",null,40,t.W1O),t.qZA(),t.TgZ(33,"td",41),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Discount"))}),t._uU(34),t.ALo(35,"number"),t.ALo(36,"number"),t.qZA(),t.TgZ(37,"td",39),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a))}),t._uU(38),t.ALo(39,"number"),t.qZA()()}if(2&o){const e=s.$implicit,n=t.MAs(13),r=t.MAs(32),a=t.oxw();t.Q6J("cdkDragDisabled",a.disabledDragItem)("ngClass",5==a.state?"Split":""),t.xp6(2),t.Q6J("ngModel",e.Splited)("hidden",5!=a.state),t.xp6(1),t.Q6J("hidden",5==a.state||!a.role.DeleteItem||a.isRetrieve&&a.AuthorizeParkedOrdersItemDeletion&&"00000000-0000-0000-0000-000000000000"!=e.ID||a.isBill),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.RowNumberVisible),t.xp6(3),t.hij("",e.Variant.Name," "),t.xp6(1),t.Q6J("ngIf",e.PromotionGift),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.CategoryVisible),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.TaxVisible),t.xp6(1),t.Q6J("ngIf",e.SerialNote)("ngIfElse",n),t.xp6(3),t.Q6J("ngIf",!a.isEmpty(e.EntityID)),t.xp6(1),t.Q6J("ngIf","00000000-0000-0000-0000-000000000000"!=e.SalesID&&e.SalesID),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.ShowBrandItemCart),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.InventoryVisible),t.xp6(1),t.Q6J("innerHtml",e.Variant.Code,t.oJD),t.xp6(2),t.Q6J("hidden",!(5==a.state&&e.Splited))("ngModel",e.SplitQuantity),t.xp6(1),t.Q6J("hidden",!(5==a.state&&e.Splited)),t.xp6(3),t.Oqu(t.xi3(25,29,e.Quantity,"1.0-4")),t.xp6(2),t.Q6J("ngIf",e.UnitQuantity>1),t.xp6(1),t.Q6J("ngIf",e.VariantUnitQuantity>1),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.UOMVisible),t.xp6(2),t.Q6J("ngIf",!a.role.PriceVisible)("ngIfElse",r),t.xp6(4),t.AsE(" ",0==e.Discount?"":t.lcZ(35,32,-1*e.Discount)+"%"," ",0==e.DiscountAmount?"":t.lcZ(36,34,-1*e.DiscountAmount)," "),t.xp6(4),t.hij(" ",a.role.PriceVisible?t.lcZ(39,36,e.Total):" - "," ")}}function mn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",56)(1,"button",57),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onReverse(a,!0))}),t._uU(2," Return "),t.qZA(),t.TgZ(3,"button",58),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onReverse(a,!1))}),t._uU(4,"Sales"),t.qZA(),t.TgZ(5,"button",57),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onSumPrice(a))}),t._uU(6," Merge / SUM Price "),t.qZA(),t.TgZ(7,"button",57),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onBundlePrice(a))}),t._uU(8," Bundle Price "),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("disabled",!e.role.Return),t.xp6(4),t.Q6J("disabled",!e.role.BundlingPrice),t.xp6(2),t.Q6J("disabled",!e.role.BundlingPrice)}}let _n=(()=>{class o{constructor(e,n,r,a,l,m,f){(0,i.Z)(this,"_shoppingCartService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"cardContainer",void 0),(0,i.Z)(this,"cartItems",[]),(0,i.Z)(this,"posStorage",void 0),(0,i.Z)(this,"AppConfigJSON",new Y.A),(0,i.Z)(this,"state",void 0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"isRetrieve",!1),(0,i.Z)(this,"AuthorizeParkedOrdersItemDeletion",!1),(0,i.Z)(this,"isBill",!1),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"disabledDragItem",void 0),(0,i.Z)(this,"isRemoveItem",!1),(0,i.Z)(this,"isUpdateItem",!1),(0,i.Z)(this,"cartItemsSource",void 0),(0,i.Z)(this,"contextMenu",void 0),(0,i.Z)(this,"contextMenuPosition",{x:"0px",y:"0px"}),this._shoppingCartService=e,this._posService=n,this._outletService=r,this._orderProcessorService=a,this._matDialog=l,this._userRoleService=m,this._orderDataService=f,this.destroy$=new v.x,this.AppConfigJSON=this._posService.Data.AppConfigJSON,this.AuthorizeParkedOrdersItemDeletion=this.AppConfigJSON.ApplicationParkAndRetrieve.AccessControl.AuthorizeParkedOrdersItemDeletion,this.scrollToBottom()}ngOnInit(){this.subscribeTobservable(),this.checkDisabledDragItem()}ngAfterViewInit(){setTimeout(()=>{this.scrollToBottom()},2e3)}scrollToBottom(){this.cardContainer&&!this.isRemoveItem&&!this.isUpdateItem&&setTimeout(()=>{this.cardContainer.nativeElement.scrollTop=this.cardContainer.nativeElement.scrollHeight},1),this.isRemoveItem=!1,this.isUpdateItem=!1}SelectState(e){switch(e){case g.J.IsBill:this.isBill=!0;break;case g.J.IsRetrieve:this.isRetrieve=!0;break;default:this.isBill=!1,this.isRetrieve=!1}}subscribeTobservable(){this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.cartItems=e.CartItems,this.cartItemsSource=e.CartItems,this.scrollToBottom()}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.state=e.posState,this.SelectState(this.state)}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e})}checkDisabledDragItem(){this.disabledDragItem=!0===window.matchMedia("(pointer: coarse)").matches}isEmpty(e){return u.gT.IsEmpty(e)}getSalesName(e){return this._outletService.getSalesname(e)}getOutletName(e){return this._posService.getOutletName(e)}onContextMenu(e,n,r){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",n.Index=r,this.contextMenu.menuData={item:n},this.contextMenu.openMenu()}drop(e){(0,B.bA)(this.cartItems,e.previousIndex,e.currentIndex)}onReverse(e,n){this.isUpdateItem=!0,n?e.Quantity>0&&(e.Quantity=-1*e.Quantity):e.Quantity<0&&(e.Quantity=-1*e.Quantity),this.isUpdateItem=!0,this._shoppingCartService.updateCartItem(e,e.Index)}onSumPrice(e){this.isUpdateItem=!0;let n=0;this.cartItems.forEach((r,a)=>{n+=r.Quantity*r.Price*(100-r.Discount)/100-r.DiscountAmount,r.Price=0}),e.Price=n/e.Quantity,this._shoppingCartService.updateCartItem(e,e.Index)}onBundlePrice(e){let n=0;this.cartItems.forEach((r,a)=>{a!=e.Index&&(n+=r.Quantity*r.Price*(100-r.Discount)/100-r.DiscountAmount,r.Price=0)}),0==e.Price&&(e.Price=n/e.Quantity),this._shoppingCartService.updateCartItem(e,e.Index)}removeItem(e){this.isRemoveItem=!0,this._shoppingCartService.deleteCartItem(e)}openItemModal(e,n){this.isUpdateItem=!0,this._matDialog.open(L.k,{data:{index:e,focus:n}})}sortItemByCode(e){const n=this.cartItems.slice();e.active&&""!==e.direction?(this.cartItems=n.sort((r,a)=>this.compare(r.Variant.Code,a.Variant.Code,"asc"===e.direction)),this._orderDataService.Data.CartItems=this.cartItems):this.cartItems=this.cartItemsSource}compare(e,n,r){return(e<n?-1:1)*(r?1:-1)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(K.F),t.Y36(x.W),t.Y36(P.o),t.Y36(M.d),t.Y36(h.uw),t.Y36(T.J),t.Y36(S.q))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart-display"]],viewQuery:function(e,n){if(1&e&&(t.Gf(Ee,5),t.Gf(w.p6,7)),2&e){let r;t.iGM(r=t.CRH())&&(n.cardContainer=r.first),t.iGM(r=t.CRH())&&(n.contextMenu=r.first)}},decls:30,vars:10,consts:[[1,"row","g-0","cart-table"],[1,"col"],["cardContainer",""],["matSort","",1,"table",3,"matSortChange"],[2,"width","18px"],[4,"ngIf"],[1,"text-start"],["style","cursor: pointer; width: 60px",4,"ngIf"],["mat-sort-header","Code","arrowPosition","before",2,"cursor","pointer","width","60px"],[1,"fas","fa-sort-amount-down","ms-1"],[1,"text-end",2,"width","50px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","20px"],[1,"text-end",2,"width","85px"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",3,"cdkDragDisabled","ngClass","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["contextMenu","matMenu"],["matMenuContent",""],[2,"cursor","pointer","width","60px"],[1,"text-end"],["cdkDrag","",3,"cdkDragDisabled","ngClass","contextmenu"],[1,"cursor"],["type","checkbox",3,"ngModel","hidden","ngModelChange"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"hidden","click"],[1,"text-start",3,"click"],["class","fa-solid fa-gift",4,"ngIf"],["class","ms-3",4,"ngIf"],["class","fst-italic m-0",4,"ngIf"],[4,"ngIf","ngIfElse"],["DEFAULT_NOTE",""],["class","text-success fst-italic",4,"ngIf"],[3,"click",4,"ngIf"],[3,"innerHtml","click",4,"ngIf"],[1,"text-end",3,"innerHtml","click"],["type","text","autoNum","",1,"text-end",2,"width","30px",3,"hidden","ngModel","ngModelChange"],[3,"hidden"],[3,"click"],[1,"text-end",3,"click"],["PRICEVISIBLE",""],[1,"text-end","text-danger",3,"click"],[1,"fa-solid","fa-gift"],[1,"ms-3"],[1,"fst-italic","m-0"],["NotTaxable",""],[1,"text-success"],[1,"text-danger"],[1,"special-TinyMCE","m-0","fst-italic",3,"innerHtml"],["class","special-TinyMCE m-0 fst-italic",3,"innerHtml",4,"ngIf"],[1,"text-warning"],[1,"text-success","fst-italic"],[3,"innerHtml","click"],["NOT_STRIKETHROUGHT",""],["class","text-decoration-line-through text-danger",4,"ngIf"],[1,"text-decoration-line-through","text-danger"],["data-cy","ctx-menu-item"],["mat-menu-item","",3,"disabled","click"],["mat-menu-item","",3,"click"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1,2)(3,"table",3),t.NdJ("matSortChange",function(a){return n.sortItemByCode(a)}),t.TgZ(4,"thead")(5,"tr"),t._UZ(6,"th",4),t.YNc(7,Fe,1,0,"th",5),t.TgZ(8,"th",6),t._uU(9,"Name"),t.qZA(),t.YNc(10,Ye,2,0,"th",7),t.YNc(11,He,2,0,"th",7),t.TgZ(12,"th",8),t._uU(13," Code "),t._UZ(14,"i",9),t.qZA(),t.TgZ(15,"th",10),t._uU(16,"Qty"),t.qZA(),t.YNc(17,Ke,1,0,"th",11),t.TgZ(18,"th",12),t._uU(19,"Price"),t.qZA(),t.TgZ(20,"th",13),t._uU(21,"Disc"),t.qZA(),t.TgZ(22,"th",14),t._uU(23,"Total"),t.qZA()()(),t.TgZ(24,"tbody",15),t.NdJ("cdkDropListDropped",function(a){return n.drop(a)}),t.YNc(25,gn,40,38,"tr",16),t.qZA()()()(),t._UZ(26,"div",17),t.TgZ(27,"mat-menu",null,18),t.YNc(29,mn,9,3,"ng-template",19),t.qZA()),2&e){const r=t.MAs(28);t.xp6(7),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.RowNumberVisible),t.xp6(3),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.ShowBrandItemCart),t.xp6(1),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.InventoryVisible),t.xp6(6),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.UOMVisible),t.xp6(8),t.Q6J("ngForOf",n.cartItems),t.xp6(1),t.Udp("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),t.Q6J("matMenuTriggerFor",r)}},dependencies:[p.mk,p.sg,p.O5,w.VK,w.OP,w.KA,w.p6,_.Fj,_.Wl,_.JJ,_.On,B.Wj,B.Zt,vt.b,ot.YE,ot.nU,D.gM,p.JJ],styles:["div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #cfcfcf}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#fbfbf7;border-left:none}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #cfcfcf}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0} .hide-arrow .mat-sort-header-arrow{color:#fff}"]})),o})();var fn=c(70075),hn=c(23339),Cn=c(30420),bn=c(31853),k=c(29990),Pt=c(82707),$=c(88796);function vn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",30),t._UZ(1,"i",31),t.TgZ(2,"ng-select",32),t.NdJ("change",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.updateTax(r))}),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(2),t.Q6J("clearable",!1)("items",e.Taxes)("ngModel",e.posData.Order.TaxTypeID)}}function xn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",33),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openDiscountModal())}),t._UZ(1,"i",34),t.TgZ(2,"span"),t._uU(3,"Discount"),t.qZA()()}}function Pn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",null==e.posData?null:e.posData.Order.Discount,"%) ")}}function On(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",t.xi3(2,1,null==e.posData?null:e.posData.Order.Discount,"1.0-4"),"%)")}}function yn(o,s){if(1&o&&(t.TgZ(0,"tr",35)(1,"th",36),t._uU(2),t.YNc(3,Pn,2,1,"span",11),t.YNc(4,On,3,4,"span",11),t.qZA(),t._UZ(5,"td",14),t.ALo(6,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(2),t.hij(" ",null==e.AppConfigJSON?null:e.AppConfigJSON.CorePrint.Alias.Discount1," "),t.xp6(1),t.Q6J("ngIf",e.isIgnoreDecimalDisc1),t.xp6(1),t.Q6J("ngIf",!(null!=e.AppConfigJSON&&e.AppConfigJSON.PrintConfigInvoice.Footer.DiscountIgnoredDecimal)),t.xp6(1),t.Q6J("innerHtml",t.lcZ(6,4,-1*e._cashierCalculatorService.Discount1Amount),t.oJD)}}function Mn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",null==e.posData?null:e.posData.Order.Discount2,"%)")}}function Dn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij(" (",t.xi3(2,1,null==e.posData?null:e.posData.Order.Discount2,"1.0-4"),"%) ")}}function Sn(o,s){if(1&o&&(t.TgZ(0,"tr")(1,"th",36),t._uU(2),t.YNc(3,Mn,2,1,"span",11),t.YNc(4,Dn,3,4,"span",11),t.qZA(),t._UZ(5,"td",14),t.ALo(6,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(2),t.hij(" ",null==e.AppConfigJSON?null:e.AppConfigJSON.CorePrint.Alias.Discount2," "),t.xp6(1),t.Q6J("ngIf",e.isIgnoreDecimalDisc2),t.xp6(1),t.Q6J("ngIf",!(null!=e.AppConfigJSON&&e.AppConfigJSON.PrintConfigInvoice.Footer.DiscountIgnoredDecimal)),t.xp6(1),t.Q6J("innerHtml",t.lcZ(6,4,-1*e._cashierCalculatorService.Discount2Amount),t.oJD)}}function Zn(o,s){if(1&o&&(t.TgZ(0,"tr"),t._UZ(1,"th",13)(2,"td",37),t.ALo(3,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("innerHtml",null==e._cashierCalculatorService||null==e._cashierCalculatorService.tax?null:e._cashierCalculatorService.tax.Label,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,2,e._cashierCalculatorService.TaxAmount),t.oJD)}}function Tn(o,s){if(1&o&&(t.TgZ(0,"tr")(1,"th",36),t._uU(2,"Deposit"),t.qZA(),t._UZ(3,"td",38),t.ALo(4,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(3),t.Q6J("innerHtml",t.lcZ(4,1,-1*(null==e.posData?null:e.posData.Order.Deposit)),t.oJD)}}function In(o,s){if(1&o&&(t.TgZ(0,"div",39)(1,"strong"),t._uU(2,"Fulfillment From: "),t.qZA(),t.TgZ(3,"span"),t._uU(4),t.qZA()()),2&o){const e=t.oxw();t.xp6(4),t.Oqu(e.getOutletName(e.posData.Action.DeliveryEntityID))}}const kn=function(o){return{"bg-gradient-warning":o}};function An(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",40),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openFullfillmentModal())}),t._UZ(1,"i",41),t.TgZ(2,"span"),t._uU(3,"Fulfillment"),t.qZA()()}if(2&o){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,kn,e.warningFullfillment))}}let wn=(()=>{class o{handleF8(){this._matDialog.openDialogs&&this._matDialog.openDialogs.length>0||this.payButtonClicked()}constructor(e,n,r,a,l,m,f,C,O,y){(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_cashierCalculatorService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_toastr",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_promotionEventService",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"posData",void 0),(0,i.Z)(this,"AppConfigJSON",void 0),(0,i.Z)(this,"Taxes",void 0),(0,i.Z)(this,"discountPromotion",[]),(0,i.Z)(this,"onlineStatus",void 0),(0,i.Z)(this,"taxInit",void 0),(0,i.Z)(this,"taxTypeID",void 0),(0,i.Z)(this,"isIgnoreDecimalDisc1",void 0),(0,i.Z)(this,"isIgnoreDecimalDisc2",void 0),(0,i.Z)(this,"warningFullfillment",void 0),(0,i.Z)(this,"isDepositEnabled",void 0),this._matDialog=e,this._orderDataService=n,this._cashierCalculatorService=r,this._posService=a,this._toastr=l,this._orderProcessorService=m,this._outletService=f,this._onlineStatusService=C,this._userRoleService=O,this._promotionEventService=y,this.destroy$=new v.x,this.Taxes=this._posService.Data.Taxes,this.AppConfigJSON=this._posService.Data.AppConfigJSON,this.isDepositEnabled=this.AppConfigJSON.ApplicationParkAndRetrieve.Deposit.Enabled}ngOnInit(){this.subscribeToObservable(),this.initOrderTypeID()}subscribeToObservable(){this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e,this.setStatusIgnoreDecimalDisc(),this.initOrderTypeID(),this.warningFullfillment=u.gT.IsEmpty(e.Action.DeliveryEntityID)}),this._onlineStatusService.getOnlineStatus$().subscribe(e=>{this.onlineStatus=e}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{let n=e.Promotion.filter(r=>"Discount"===r.PromotionTypeString);this.discountPromotion=n})}setStatusIgnoreDecimalDisc(){this.isIgnoreDecimalDisc1=this.checkIgnoreDecimalDisc(this.posData.Order.Discount),this.isIgnoreDecimalDisc2=this.checkIgnoreDecimalDisc(this.posData.Order.Discount2)}initOrderTypeID(){0==this.posData.Order.TypeID&&(this.posData.Order.TypeID=this._posService.Data.PoTypes[0].ID)}updateTax(e){this._orderDataService.Data.Order.TaxTypeID=e.ID,this._cashierCalculatorService.tax=e,this._orderDataService.pushNewValue()}payButtonClicked(){this.isCartNotEmpty()&&this.validateEmptySalesOrder()&&this.validateNegativePayment()&&this.isSalesPersonValid()&&this.validateCustomerID()&&this.isCustomerRequired()&&this.validatePromotionDiscount()&&this.OpenPaymentModal()}validateNegativePayment(){let e=!0;return 0==this.AppConfigJSON.ModuleSell.PaymentDialog.MinusPaymentAllowed&&this._cashierCalculatorService.Data<0&&(e=!1,this._toastr.warning("You are not allowed to process this transaction because the total amount is less than zero","Warning!")),e}validatePromotionDiscount(){let n=(this._outletService.Data.Promotion?this._outletService.Data.Promotion:[]).find(m=>m.TypeID===Pt.qe.Discount),a=this._promotionEventService.selectedPromotion,l=!0;return this.AppConfigJSON.ModuleSell.MandatoryActiveDiscount&&n&&(a?a.TypeID!=Pt.qe.Discount&&(l=!1):l=!1),0==l&&(this._matDialog.open(pt.t,{id:"promotion-event"}),this._toastr.warning("You need to apply Discount promotion","Required Promotion")),l}OpenPaymentModal(){this._matDialog.open(fn.n,{id:"ModalPayment",disableClose:!0}).afterClosed().pipe((0,d.R)(this.destroy$)).subscribe()}isCartNotEmpty(){return!(this.posData.CartItems.length<1&&(this._toastr.warning(k.g.emptyPOItem,"Warning!"),1))}validateEmptySalesOrder(){return!u.gT.IsEmpty(this.posData.Order.Number)||(this._toastr.warning(k.g.emptyOrderNumber,"Warning!"),!1)}isSalesPersonValid(){return!this.AppConfigJSON.ModuleSell.Header.SalesPersonRequired||this.posData.Order.SalesID!=u.gT.GuidEmpty&&null!=this.posData.Order.SalesID||!!this.posData.CartItems.every(e=>u.gT.IsNotEmpty(e.SalesID))||(this._toastr.warning(k.g.emptySalesPerson,"Warning!"),!1)}isCustomerRequired(){return!(this.AppConfigJSON.ModuleSell.Header.CustomerRequired&&this.onlineStatus&&u.gT.IsEmpty(this.posData.Order.CustomerID)&&(this._toastr.warning(k.g.emptyCustomer,"Warning!"),1))}validateCustomerID(){if(u.gT.IsEmpty(this.posData.Order.CustomerID)){let n=this._orderProcessorService.Data.InputTextValue;if(u.gT.IsNotEmpty(n)&&(this._toastr.warning("Customer is not Saved","Warning"),this.AppConfigJSON.ModuleSell.Customer.QuickAddEnabled))return this.openCustomerModal(n),!1}return!0}openCustomerModal(e){this._matDialog.open(ht.A,{data:{name:e},autoFocus:!1}).afterClosed().subscribe(n=>{n&&this.OpenPaymentModal()})}openDiscountModal(){this._matDialog.open(xt)}openClearOrderModal(){this._matDialog.open(hn.U)}openNotesModal(){this._matDialog.open(Cn.$,{width:"45%"})}openFullfillmentModal(){this._matDialog.open(bn.D)}getOutletName(e){if(!u.gT.IsEmpty(e))return this._posService.getOutletName(e)}isFulfillmentVisible(e,n){return!u.gT.IsEmpty(n)&&e!=n}checkIgnoreDecimalDisc(e){return this.AppConfigJSON.PrintConfigInvoice.Footer.DiscountIgnoredDecimal&&e%1==0}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(h.uw),t.Y36(S.q),t.Y36(H.J),t.Y36(x.W),t.Y36(U._W),t.Y36(M.d),t.Y36(P.o),t.Y36(J.q),t.Y36(T.J),t.Y36(X.D))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart-action"]],hostBindings:function(e,n){1&e&&t.NdJ("keydown.F8",function(a){return n.handleF8(a)},!1,t.Jf7)},decls:52,vars:28,consts:[[1,"row","g-0","cart-footer","justify-content-between"],[1,"col-auto","align-self-center","mobile-view"],[1,"row","g-0"],["class","col-auto mx-5 d-flex flex-row",4,"ngIf"],[1,"col-auto"],["data-cy","Discount","class","btn btn-gray fw-normal disc",3,"click",4,"ngIf"],[1,"col-auto","summary","mobile-view"],[1,"table",3,"hidden"],[1,"table-light","border-top-0",2,"vertical-align","middle","line-height","30px !important"],[1,"text-end","border-top-0",2,"width","100px",3,"innerHtml"],["context-menu","ctrl.MenuDiscount",4,"ngIf"],[4,"ngIf"],[3,"hidden"],[1,"table-light",2,"vertical-align","middle","line-height","30px !important",3,"innerHtml"],[1,"text-danger","text-end","text-danger",3,"innerHtml"],[1,"text-end",3,"ngClass","innerHtml"],[1,"mt-5","row","g-0","action-buttons","justify-content-between"],[1,"col-auto","mobile-view"],[1,"position-relative"],["class","cashier-note-arrow arrow-box-right",4,"ngIf"],["class","btn btn-gray mobile-view","data-cy","Fulfillment",3,"ngClass","click",4,"ngIf"],[1,"col-auto","mobile-view","ms-3"],["data-cy","Note",1,"btn","btn-gray","w-100",3,"click"],[1,"fa-regular","fa-note-sticky","pe-2"],[1,"btn","btn-gray","mobile-view",3,"hidden","click"],[1,"fa-regular","fa-rectangle-xmark","pe-2"],["data-cy","PaySales",1,"ms-auto","btn","btn-success","pay","mobile-view",3,"hidden","click"],[1,"d-flex"],[1,"ms-auto"],[1,"position-absolute","fst-italic","right-bottom"],[1,"col-auto","mx-5","d-flex","flex-row"],["aria-hidden","true",1,"fa","fa-tags","d-flex","align-items-center","me-2"],["bindLabel","Label","bindValue","ID","placeholder","Tax","data-cy","Tax",2,"width","125px",3,"clearable","items","ngModel","change"],["data-cy","Discount",1,"btn","btn-gray","fw-normal","disc",3,"click"],["aria-hidden","true",1,"fa","fa-tags","pe-2"],["context-menu","ctrl.MenuDiscount"],[1,"table-light",2,"vertical-align","middle","line-height","30px !important"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"],[1,"cashier-note-arrow","arrow-box-right"],["data-cy","Fulfillment",1,"btn","btn-gray","mobile-view",3,"ngClass","click"],[1,"fa","fa-truck","pe-2"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t.YNc(3,vn,3,3,"div",3),t.TgZ(4,"div",4),t.YNc(5,xn,4,0,"a",5),t.qZA()()(),t.TgZ(6,"div",6)(7,"table",7)(8,"tbody")(9,"tr")(10,"th",8),t._uU(11,"Amount"),t.qZA(),t._UZ(12,"td",9),t.ALo(13,"number"),t.qZA(),t.YNc(14,yn,7,6,"tr",10),t.YNc(15,Sn,7,6,"tr",11),t.TgZ(16,"tr",12),t._UZ(17,"th",13)(18,"td",14),t.ALo(19,"number"),t.qZA(),t.YNc(20,Zn,4,4,"tr",11),t.TgZ(21,"tr",12),t._UZ(22,"th",13)(23,"td",15),t.ALo(24,"number"),t.qZA(),t.YNc(25,Tn,5,3,"tr",11),t.qZA()()()(),t.TgZ(26,"div",16)(27,"div",17)(28,"div",18),t.YNc(29,In,5,1,"div",19),t.YNc(30,An,4,3,"a",20),t.qZA()(),t.TgZ(31,"div",21)(32,"a",22),t.NdJ("click",function(){return n.openNotesModal()}),t._UZ(33,"i",23),t.TgZ(34,"span"),t._uU(35,"Note"),t.qZA()()(),t.TgZ(36,"div",21)(37,"a",24),t.NdJ("click",function(){return n.openClearOrderModal()}),t._UZ(38,"i",25),t.TgZ(39,"span"),t._uU(40,"Clear"),t.qZA()()(),t.TgZ(41,"div",21)(42,"a",26),t.NdJ("click",function(){return n.payButtonClicked()}),t.TgZ(43,"div",27)(44,"strong"),t._uU(45,"Pay:"),t.qZA(),t.TgZ(46,"span",28),t._uU(47),t.ALo(48,"number"),t.qZA()(),t.TgZ(49,"small",29),t._uU(50,"(F8)"),t.qZA()()()(),t._UZ(51,"div")),2&e&&(t.xp6(3),t.Q6J("ngIf",n.role.Tax),t.xp6(2),t.Q6J("ngIf",n.role.Discount),t.xp6(2),t.Q6J("hidden",!n.role.PriceVisible),t.xp6(5),t.Q6J("innerHtml",t.lcZ(13,20,n._cashierCalculatorService.GrossTotal),t.oJD),t.xp6(2),t.Q6J("ngIf",0!=(null==n.posData?null:n.posData.Order.Discount)),t.xp6(1),t.Q6J("ngIf",0!=(null==n.posData?null:n.posData.Order.Discount2)),t.xp6(1),t.Q6J("hidden",0==(null==n.posData?null:n.posData.Order.DiscountAmount)),t.xp6(1),t.Q6J("innerHtml",(null==n.AppConfigJSON?null:n.AppConfigJSON.CorePrint.Alias.DiscountAmount)+" "+(null==n._cashierCalculatorService?null:n._cashierCalculatorService.currencySymbol),t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(19,22,-1*(null==n.posData?null:n.posData.Order.DiscountAmount)),t.oJD),t.xp6(2),t.Q6J("ngIf",null==n._cashierCalculatorService||null==n._cashierCalculatorService.tax?null:n._cashierCalculatorService.tax.Rate),t.xp6(1),t.Q6J("hidden",0==(null==n.posData?null:n.posData.Invoice.SurchargePcg)),t.xp6(1),t.Q6J("innerHtml","SURCHARGE "+(null==n.posData?null:n.posData.Invoice.SurchargePcg)+" %",t.oJD),t.xp6(1),t.Q6J("ngClass",(null==n.posData?null:n.posData.Invoice.SurchargePcg)<0?"text-danger":"")("innerHtml",t.lcZ(24,24,n._cashierCalculatorService.SurchargeAmount),t.oJD),t.xp6(2),t.Q6J("ngIf",(null==n.posData?null:n.posData.Order.Deposit)>0&&n.isDepositEnabled),t.xp6(4),t.Q6J("ngIf",n.isFulfillmentVisible(n.posData.Order.EntityID,n.posData.Action.DeliveryEntityID)),t.xp6(1),t.Q6J("ngIf",n.role.Shipping),t.xp6(7),t.Q6J("hidden",n.role.ClearCartRestriction),t.xp6(5),t.Q6J("hidden",!n.role.Payment),t.xp6(5),t.Oqu(n.role.PriceVisible?t.lcZ(48,26,n._cashierCalculatorService.Data):"-"))},dependencies:[p.mk,p.O5,$.w9,_.JJ,_.On,p.JJ],styles:['div.row.cart-footer[_ngcontent-%COMP%]{border-top:solid 1px #cfcfcf;min-height:85px}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;border-left:solid 1px #cfcfcf;border-bottom:solid 1px #cfcfcf;line-height:16px!important}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:5px 8px}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:5px}div.row.cart-footer[_ngcontent-%COMP%] .disc[_ngcontent-%COMP%]{padding-top:7px;padding-bottom:6px}div.row.action-buttons[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{font-size:1.125rem;padding:15px 16px}div.row.action-buttons[_ngcontent-%COMP%] .btn-success[_ngcontent-%COMP%]{width:195px}div.row.action-buttons[_ngcontent-%COMP%] .right-bottom[_ngcontent-%COMP%]{font-size:.625rem;right:4px}.cashier-note-arrow[_ngcontent-%COMP%]{position:absolute;min-width:130px;max-width:180px;min-height:55px;background-color:#ffffe1!important;right:110%;top:0%;z-index:1;text-align:center;padding:8px 2px;border:1px solid #bbbbbb!important}.cashier-note-arrow[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-style:italic}.cashier-note-arrow[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-top:3px;font-family:Roboto Slab,serif;display:block;text-transform:uppercase}.cashier-note-arrow[_ngcontent-%COMP%]:after{border-left-color:#ffffe1!important}.arrow-box-right[_ngcontent-%COMP%]:before{border-width:6px!important;margin-top:-6px!important}@media (max-width: 575.98px){.mobile-view[_ngcontent-%COMP%]{width:100%!important;margin-top:5px}}.arrow-box-right[_ngcontent-%COMP%]{position:absolute;background:white;border:2px solid #bbbbbb;border-radius:.25rem}.arrow-box-right[_ngcontent-%COMP%]:after, .arrow-box-right[_ngcontent-%COMP%]:before{left:100%;top:50%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-right[_ngcontent-%COMP%]:after{border-color:#0000;border-left-color:#fff;border-width:5px;margin-top:-5px}.arrow-box-right[_ngcontent-%COMP%]:before{border-color:#c2e1f500;border-left-color:#bbb;border-width:8px;margin-top:-8px}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #d6d6d6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}']})),o})(),Nn=(()=>{class o{constructor(){}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart"]],decls:4,vars:0,consts:[[1,"cashier"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"pos-cart-header")(2,"pos-cart-display")(3,"pos-cart-action"),t.qZA())},dependencies:[Re,_n,wn],styles:['@media print{.cashier[_ngcontent-%COMP%], pos-quick-key[_ngcontent-%COMP%], pos-header[_ngcontent-%COMP%], pos-toolbar[_ngcontent-%COMP%]{display:none}}.quickKey[_ngcontent-%COMP%]{margin-right:10px}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-webkit-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-ms-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.quickKey[_ngcontent-%COMP%]{width:420px;margin-right:10px}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.cart[_ngcontent-%COMP%]{width:570px}@media only screen and (max-width: 1280px){input[id=ContactID][_ngcontent-%COMP%]{width:135px}}@media only screen and (max-width: 1215px){input[id=ContactID][_ngcontent-%COMP%]{width:120px}}@media only screen and (max-width: 1185px){input[id=ContactID][_ngcontent-%COMP%]{width:140px}} .hg-theme-default .hg-button{height:70px!important;font-size:16px!important} .hg-button-bksp{width:21px} .hg-button[data-skbtn="{enter}"][_ngcontent-%COMP%]{width:90px}.cashier[_ngcontent-%COMP%]{max-width:37rem;min-width:34rem}@media (max-width: 1200px){.cashier[_ngcontent-%COMP%]{width:40rem}}@media (max-width: 1172px){.cashier[_ngcontent-%COMP%]{width:30rem}}']})),o})();var Jn=c(11989),Un=c(61135);let Ot=(()=>{class o{get _appConfigJSON(){return this._posService.Data.AppConfigJSON}constructor(e,n,r,a){(0,i.Z)(this,"_cartService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"Items",void 0),(0,i.Z)(this,"_quickKeySubject",new Un.X(new Jn.AM)),(0,i.Z)(this,"quickKey$",this._quickKeySubject.asObservable()),this._cartService=e,this._posService=n,this._orderDataService=r,this._matDialog=a,this._orderDataService.Data$.subscribe(l=>{this.Items=l.CartItems})}addQuickKeyItem(e){this._cartService.addCartItemById(e).then(()=>{this._appConfigJSON.ModuleSell.ProductDialog.OpenOnNewItemAdded&&this._matDialog.open(L.k,{data:{index:this.Items.length-1}})}).catch(n=>{window.alert(n)})}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.LFG(K.F),t.LFG(x.W),t.LFG(S.q),t.LFG(h.uw))}),(0,i.Z)(o,"\u0275prov",t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"})),o})();var N=c(3848);function Qn(o,s){if(1&o&&t._UZ(0,"img",17),2&o){const e=t.oxw().$implicit;t.Q6J("src",e.ImageURLClient.indexOf("cloudinary")>-1?"https:"+e.ImageURLClient:e.ImageURLClient,t.LSH)}}function qn(o,s){if(1&o&&(t.TgZ(0,"p"),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.Dn7(2,1,e.Display,0,3))}}function Rn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",13)(1,"a",14),t.NdJ("click",function(){const a=t.CHM(e).$implicit,l=t.oxw(3);return t.KtG(l.select(a))}),t.YNc(2,Qn,1,1,"img",15),t.YNc(3,qn,3,5,"p",16),t.TgZ(4,"small"),t._uU(5),t.ALo(6,"slice"),t.qZA()()()}if(2&o){const e=s.$implicit;t.xp6(2),t.Q6J("ngIf",e.ImageURLClient),t.xp6(1),t.Q6J("ngIf",!e.ImageURLClient),t.xp6(2),t.Oqu(t.Dn7(6,3,e.Display,0,36))}}const yt=function(){return["/menu/Outlets/Master/Quick_Key_Templates/Form"]},En=function(o){return{ID:o}};function Fn(o,s){if(1&o&&(t.TgZ(0,"mat-tab",6)(1,"div",7)(2,"div",8),t.YNc(3,Rn,7,7,"div",9),t.TgZ(4,"div",10)(5,"a",11),t._UZ(6,"i",12),t.qZA()()()()()),2&o){const e=s.$implicit,n=t.oxw(2);t.Q6J("label",e.Name),t.xp6(3),t.Q6J("ngForOf",e.Items),t.xp6(2),t.Q6J("routerLink",t.DdM(4,yt))("queryParams",t.VKq(5,En,n.quickKey.ID))}}function Yn(o,s){if(1&o&&(t.TgZ(0,"mat-tab-group",4),t.YNc(1,Fn,7,7,"mat-tab",5),t.qZA()),2&o){const e=t.oxw();t.Q6J("disableRipple",!0)("hidden",e.subQuickKey),t.xp6(1),t.Q6J("ngForOf",e.quickKey.Groups)}}function Hn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",13)(1,"a",14),t.NdJ("click",function(){const a=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.selectChild(a.ID))}),t.TgZ(2,"p"),t._uU(3),t.ALo(4,"limitTo"),t.qZA(),t.TgZ(5,"small"),t._uU(6),t.ALo(7,"limitTo"),t.qZA()()()}if(2&o){const e=s.$implicit;t.xp6(3),t.Oqu(t.xi3(4,2,e.Model,3)),t.xp6(3),t.Oqu(t.xi3(7,5,e.Model,30))}}function Kn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.back())}),t.TgZ(2,"div",20),t._UZ(3,"i",21),t.qZA(),t.TgZ(4,"div",22)(5,"b"),t._uU(6),t.qZA()()(),t.TgZ(7,"div",23),t.YNc(8,Hn,8,8,"div",9),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(6),t.hij(" ",e.subQuickKey.Name," "),t.xp6(2),t.Q6J("ngForOf",e.subQuickKey.Items)}}const Ln=function(o){return{OutletID:o}};function Bn(o,s){if(1&o&&(t.TgZ(0,"a",24)(1,"strong"),t._uU(2,"QUICK KEYS UNCONFIGURED"),t.qZA(),t._UZ(3,"i",25),t.TgZ(4,"span"),t._uU(5,"Click here to setup your Quick keys"),t.qZA()()),2&o){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,yt))("queryParams",t.VKq(3,Ln,e.entityID))}}const $n=function(o){return{"no-quick-key":o}};let Gn=(()=>{class o{constructor(e,n){(0,i.Z)(this,"_quickKeyService",void 0),(0,i.Z)(this,"_outletRegisterService",void 0),(0,i.Z)(this,"data",void 0),(0,i.Z)(this,"entityID",void 0),(0,i.Z)(this,"quickKey",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"subQuickKey",void 0),(0,i.Z)(this,"NextProductID",void 0),this._quickKeyService=e,this._outletRegisterService=n,this.destroy$=new v.x}ngOnInit(){this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._outletRegisterService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.entityID=e.EntityID,this.setQuickey(e.QuickKeyPack)})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}setQuickey(e){if(e){let n;e.Groups&&0!==e.Groups.length&&(n=e.Groups),this.quickKey=n?e:null}}addQuickKeyItem(e){this._quickKeyService.addQuickKeyItem(e)}selectChild(e){this.addQuickKeyItem(e),this.back(),this.openNextProduct(this.NextProductID)}select(e){this.NextProductID=e.NextProductID,!e.Children||e.Children.length<1?this.selectChild(e.ItemID):1==e.Children.length?this.selectChild(e.Children[0].ID):this.subQuickKey={Items:e.Children,Name:e.Display}}openNextProduct(e){u.gT.IsNotEmpty(e)&&this.data.Groups.forEach(n=>{const r=n.Items.find(a=>a.ProductID==e);null!=r&&r.Children.length>1&&(this.NextProductID=r.NextProductID,this.subQuickKey={Items:r.Children,Name:r.Display})})}back(){delete this.subQuickKey}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(Ot),t.Y36(P.o))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-quick-key"]],inputs:{data:"data"},decls:5,vars:6,consts:[[1,"quickKeys",3,"ngClass"],["animationDuration","0ms",3,"disableRipple","hidden",4,"ngIf","ngIfElse"],["class","container",4,"ngIf"],["noQuickKey",""],["animationDuration","0ms",3,"disableRipple","hidden"],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[1,"container","tabItems"],[1,"row","g-0"],["class","col-3 column",4,"ngFor","ngForOf"],[1,"col-3","column","add"],[3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-circle-plus","fa-5x","d-flex","align-items-center","justify-content-center","bg-white","h-100","text-primary"],[1,"col-3","column"],[3,"click"],[3,"src",4,"ngIf"],[4,"ngIf"],[3,"src"],[1,"container"],[1,"row","g-0","border","align-items-center","variants-header","cursor",3,"click"],[1,"col-auto","border-end","py-5","px-7"],["aria-hidden","true",1,"fa","fa-arrow-left"],[1,"col","text-center","fw-bold","text-uppercase","h5"],[1,"tabItems","row","g-0"],["id","LinkConfigureQuickkey","target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-regular","fa-hand-pointer"]],template:function(e,n){if(1&e&&(t.TgZ(0,"section",0),t.YNc(1,Yn,2,3,"mat-tab-group",1),t.YNc(2,Kn,9,2,"div",2),t.YNc(3,Bn,6,5,"ng-template",null,3,t.W1O),t.qZA()),2&e){const r=t.MAs(4);t.Q6J("ngClass",t.VKq(4,$n,!n.quickKey)),t.xp6(1),t.Q6J("ngIf",n.quickKey)("ngIfElse",r),t.xp6(1),t.Q6J("ngIf",n.subQuickKey)}},dependencies:[p.mk,p.sg,p.O5,N.uX,N.SP,b.rH,p.OU,Z.OI],styles:['.btn-add[_ngcontent-%COMP%]{-webkit-border-radius:50%;-moz-border-radius:50%;padding:6px 10px;cursor:pointer;right:-14px;top:5px;border:solid 1px #dddddd}section.quickKeys.no-quick-key[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Cashier/no-quick-key.png);background-repeat:no-repeat;height:544px;position:relative}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:80px;width:80px;display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #dddddd}.quickKeys[_ngcontent-%COMP%] .row.g-0.border.align-items-center.variants-header.cursor[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}.btn-add[_ngcontent-%COMP%]{-webkit-border-radius:50%;-moz-border-radius:50%;padding:6px 10px;cursor:pointer;right:-14px;top:5px;border:solid 1px #DDDDDD}section.quickKeys.no-quick-key[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Cashier/no-quick-key.png);background-repeat:no-repeat;height:544px}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%]{border-bottom:0px;display:flex;border-radius:3px;cursor:pointer}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]{background:#ffffff;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#eeeeee",GradientType=0);height:44px;max-height:44px;overflow:hidden;color:#aaa!important;font-size:14px;text-decoration:none;font-weight:700;outline:none;text-transform:uppercase;text-align:center;min-width:25%;display:flex;justify-content:center}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{align-self:center;text-align:center}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:last-child{border-right:none}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n){border-right:none}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:first-child{border-left:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(-n+4){border-right:1px solid #cfcfcf;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+1){border-left:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+2){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+3){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+4){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(n+5){width:25%;flex-grow:0}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col.active[_ngcontent-%COMP%]{color:#268ec1!important}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%]{padding:0}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]{margin-top:15px;margin-bottom:10px;word-break:break-all}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border:solid 1px #cfcfcf}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-align:center;display:block;cursor:pointer}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:80px;width:80px;display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #DDDDDD}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{height:80px;width:80px;font-size:20px;display:block;margin:0 auto;padding-top:22px;background-color:#a6a6a6;border:solid 1px #999999;border-top-left-radius:5px;border-bottom-right-radius:5px;color:#fff}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#000;font-size:11px;display:block;margin:5px 0 0}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] .ion-icon[_ngcontent-%COMP%]{font-size:75px;margin:10px}.quickKeys[_ngcontent-%COMP%] .variants-header[_ngcontent-%COMP%]{background:#ffffff;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#eeeeee",GradientType=0);color:#268ec1;cursor:pointer}.quickKeys[_ngcontent-%COMP%] .col-md-3.column.add[_ngcontent-%COMP%]{cursor:pointer}.quickKeys[_ngcontent-%COMP%] .col-md-3.column.add[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-top:10px}.quickKeys[_ngcontent-%COMP%] i.icon-col.fa.fa-xmark.text-danger[_ngcontent-%COMP%]{color:#fb404b!important;position:absolute;right:16px;top:5px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%]{background-color:#479ccf;padding:15px 25px;color:#fff;text-decoration:none;width:240px;display:block;opacity:.85;border-radius:5px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%]{position:absolute;top:120px;left:90px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%]:hover, .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%]:hover{opacity:.95}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%]{border-bottom:1px solid white;font-size:14px;margin:0 0 10px;padding:0 0 3px;display:block}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:inline-block;height:35px;margin:0 10px 0 0;font-size:28px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;font-size:14px;width:135px;vertical-align:top}.quickKeys[_ngcontent-%COMP%] .row.no-gutters.border.align-items-center.variants-header.cursor[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}.general-information[_ngcontent-%COMP%] ol.mt-5.ml-5.pl-7[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{line-height:20px}.quickKeys[_ngcontent-%COMP%] {width:420px;position:relative}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-header-pagination{display:none!important}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-header{border-bottom:none}.quickKeys[_ngcontent-%COMP%] .mdc-tab-indicator{display:none!important}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels{border-bottom:0px;display:flex;flex-wrap:wrap}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab{height:44px;max-height:44px;overflow:hidden;padding:0!important;border-right:1px solid #cfcfcf;min-width:25%!important;flex-grow:1;flex-basis:0;font-size:14px;font-weight:700;outline:none;text-transform:uppercase;background:#ffffff;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#eeeeee",GradientType=0);display:flex;white-space:normal!important}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab .mdc-tab__content{white-space:normal!important;align-self:center}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n){border-right:none}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:first-child{border-left:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(-n+4){border-right:1px solid #cfcfcf;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+1){border-left:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+2){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+3){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+4){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(n+5){width:25%;flex-grow:0}@media (max-width: 1092px){.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab{font-size:12px}}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mdc-tab--active .mdc-tab__text-label{color:#268ec1!important;text-shadow:0px 0px 1px #268ec1!important}@media (max-width: 1210px){.quickKeys[_ngcontent-%COMP%]{width:340px}}']})),o})();var Mt=c(30273),Vn=c(15861),zn=c(39064),jn=c(30012),Wn=c(37646),Xn=c(74683),to=c(59810),eo=c(90764),no=c(84254),oo=c(89748),Dt=c(47130),St=c(82621),G=c(117),V=c(98448),Zt=c(33142);function io(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",10),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPark())}),t._uU(1),t.qZA()}if(2&o){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.AppConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkButtonLabel||"Park"," ")}}function ro(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",11),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.showRetrieveModal())}),t._uU(1," Retrieve "),t.qZA()}}function ao(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",12),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSplit())}),t._uU(1),t.qZA()}if(2&o){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.isSplit()?"Cancel":"Split"," ")}}function so(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPrintRetrieve())}),t._uU(1," Print "),t.qZA()}}function co(o,s){if(1&o&&(t.TgZ(0,"ul",5),t.YNc(1,io,2,1,"li",6),t.YNc(2,ro,2,0,"li",7),t.YNc(3,ao,2,1,"li",8),t.YNc(4,so,2,0,"li",9),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)&&(!e.IsEdit()||e.isRetrive())),t.xp6(1),t.Q6J("ngIf",e.role.Retrieve&&(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)),t.xp6(1),t.Q6J("ngIf",(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)&&(e.isRetrive()||e.isSplit())),t.xp6(1),t.Q6J("ngIf",(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)&&e.isRetrive())}}function lo(o,s){if(1&o&&t._UZ(0,"pos-receipt-a4",14),2&o){const e=t.oxw();t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)("outletInfo",e.outletInfo)}}function po(o,s){if(1&o&&t._UZ(0,"POS-bill-receipt-A4",14),2&o){const e=t.oxw();t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)("outletInfo",e.outletInfo)}}function uo(o,s){if(1&o&&t._UZ(0,"pos-receipt",15),2&o){const e=t.oxw();t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletInfo)}}function go(o,s){if(1&o&&t._UZ(0,"park-order",16),2&o){const e=t.oxw();t.Q6J("data",e.parkMini)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)}}let mo=(()=>{class o{constructor(e,n,r,a,l,m,f,C,O,y){(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_receiptService",void 0),(0,i.Z)(this,"toastr",void 0),(0,i.Z)(this,"matDialog",void 0),(0,i.Z)(this,"_orderHttpService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_promotionEvent",void 0),(0,i.Z)(this,"AppConfig",new Y.A),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"orderProcessor",new zn.K),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"ParkLayoutPack",void 0),(0,i.Z)(this,"Payments",void 0),(0,i.Z)(this,"parkMini",void 0),(0,i.Z)(this,"outletInfo",void 0),(0,i.Z)(this,"park",void 0),(0,i.Z)(this,"parkOrderRetrieve",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"completeData",void 0),(0,i.Z)(this,"receiptTemplate",void 0),(0,i.Z)(this,"printMode",void 0),(0,i.Z)(this,"isPrintBIll",void 0),this._posService=e,this._orderProcessorService=n,this._orderDataService=r,this._outletService=a,this._receiptService=l,this.toastr=m,this.matDialog=f,this._orderHttpService=C,this._userRoleService=O,this._promotionEvent=y,this.printMode=2,this.destroy$=new v.x,this.subscribeToObservable(),this.Payments=this._posService.Data.Payments,this.AppConfig=this._posService.Data.AppConfigJSON}ngOnInit(){this.parkMini=null}subscribeToObservable(){this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.orderProcessor=e,this.checkPrintParkOrder()}),this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.outletInfo=e,this.ParkLayoutPack=e.ParkLayoutPack,this.park=new eo.f(this.ParkLayoutPack)}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e})}onPark(){if(this.AppConfig.ModuleSell.Header.CustomerRequired&&null==this.posData.Order.CustomerID)return void this.toastr.warning("Customer is needed before parking orders!","Missing customer!");if(u.gT.IsNotEmpty(this._promotionEvent.selectedPromotion)||u.gT.IsNotEmpty(this.posData.Order.AuthorizationKey))return void this.toastr.warning("sorry, you're using a promotion, can't use park!","can't use park when using promotions!");let n=!0;if(u.gT.IsEmpty(this.posData.Order.RegisterID)&&(this.toastr.warning(k.g.emptyEntity,z.n.Warning),n=!1),this.isSplit()){const r=this.posData.CartItems.filter(a=>a.Splited).length;!r&&this.posData.CartItems.length!=r&&(this.toastr.warning(k.g.emptyPOItem,z.n.Warning),n=!1)}if(0==this._orderDataService.Data.CartItems.length&&(this.toastr.warning("You must have at least one item","No Item in Cart!"),n=!1),n)if(this.ParkLayoutPack&&u.gT.IsNotEmpty(this.ParkLayoutPack.ID))this.isRetrive()&&!this.isSplit()?this.showReparkModal():this.showParkSelectModal();else{if(1==this.AppConfig.ApplicationParkAndRetrieve.Advance.retreiveMode)return void this.toastr.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!");const r=this.AppConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.DefaultParkNoteValue;!this.IsEdit()&&""!=r&&u.gT.IsEmpty(this.posData.Order.Note)&&(this.posData.Order.Note=r),this.showParkFormModal()}}showRetrieveModal(){this.ParkLayoutPack&&u.gT.IsEmpty(this.ParkLayoutPack.Layout)&&1==this.AppConfig.ApplicationParkAndRetrieve.Advance.retreiveMode?this.toastr.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!"):this.matDialog.open(to.Q).afterClosed().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.parkOrderRetrieve=e})}onSplit(){this._orderProcessorService.updatePosState(this.orderProcessor.posState==g.J.IsRetrieve?g.J.IsSplit:g.J.IsRetrieve)}IsEdit(){return this.orderProcessor.posState==g.J.IsEdit}isRetrive(){return this.orderProcessor.posState==g.J.IsRetrieve}isSplit(){return this.orderProcessor.posState==g.J.IsSplit}showReparkModal(){this.matDialog.open(jn.E,{data:this.parkOrderRetrieve})}showParkSelectModal(){this._orderHttpService.getVacant(this.posData.Order.EntityID).subscribe(e=>{this.matDialog.open(Wn.$,{data:{title:this.orderProcessor.posState==g.J.IsSplit?"Split Order":this.AppConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle,parkLayoutPack:this.ParkLayoutPack,qty:this.posData.TotalQuantity,entityId:this.posData.Order.EntityID,occupied:e.Orders,replaceWithAlias:this.AppConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias}})})}showParkFormModal(e){let n="PARK Details";e&&(n="# "+e),this.isSplit()&&(n="Split Detail"),this.matDialog.open(Xn.P,{id:"park-form-modal",data:{title:n,labelDisable:this.ParkLayoutPack&&u.gT.IsNotEmpty(this.ParkLayoutPack.ID)||this.orderProcessor.posState==g.J.IsSplit,ParkLabel:e||this.posData.Order.ParkLabel}})}checkPrintParkOrder(){this.orderProcessor.posState==g.J.isPark&&this.AppConfig.ApplicationParkAndRetrieve.PrintBehaviour.PrintAfterPark&&this.printPark(!0)}printPark(e){this.parkMini=this._receiptService.generateParkReceipt(e),this.printWindow().then(()=>{this.parkMini=null})}onPrintRetrieve(){this.AppConfig.ApplicationParkAndRetrieve.Basic.EnablePrintBill?this.matDialog.open(no.n).afterClosed().pipe((0,Ct.h)(n=>u.gT.IsNotEmpty(n))).subscribe(n=>{"ORDER"==n?this.printPark(!1):(this.isPrintBIll=!0,this.printBill())}):this.printPark(!1)}printBill(){let e;this.printMode=this.outletInfo.PrintTemplate.PrintMode,oo.LA.A4==this.printMode?(e=this._receiptService.generateBillInvoice(),this.receiptTemplate=e):(e=this._receiptService.generateBillReceipt(),this.receiptTemplate=e),this.printWindow().then(()=>{this.receiptTemplate=null,this.isPrintBIll=!1})}printWindow(){return(0,Vn.Z)(function*(){return new Promise(e=>{setTimeout(()=>{window.print(),e()},500)})})()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(x.W),t.Y36(M.d),t.Y36(S.q),t.Y36(P.o),t.Y36(Dt.V),t.Y36(U._W),t.Y36(h.uw),t.Y36(j.D),t.Y36(T.J),t.Y36(X.D))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-sidebutton"]],decls:6,vars:5,consts:[["class","park-action",4,"ngIf"],[1,"print_containers"],[3,"data","printTemplate","config","outletInfo",4,"ngIf"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo",4,"ngIf"],[3,"data","printTemplate","config",4,"ngIf"],[1,"park-action"],["id","btnPark","data-cy","btnPark","class","park",3,"click",4,"ngIf"],["class","retrieve","data-cy","btnRetreive",3,"click",4,"ngIf"],["class","split",3,"click",4,"ngIf"],["class","retrieve",3,"click",4,"ngIf"],["id","btnPark","data-cy","btnPark",1,"park",3,"click"],["data-cy","btnRetreive",1,"retrieve",3,"click"],[1,"split",3,"click"],[1,"retrieve",3,"click"],[3,"data","printTemplate","config","outletInfo"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo"],[3,"data","printTemplate","config"]],template:function(e,n){1&e&&(t.YNc(0,co,5,4,"ul",0),t.TgZ(1,"div",1),t.YNc(2,lo,1,4,"pos-receipt-a4",2),t.YNc(3,po,1,4,"POS-bill-receipt-A4",2),t.YNc(4,uo,1,5,"pos-receipt",3),t.YNc(5,go,1,3,"park-order",4),t.qZA()),2&e&&(t.Q6J("ngIf",n.AppConfig),t.xp6(2),t.Q6J("ngIf",n.receiptTemplate&&1==n.printMode&&!n.isPrintBIll),t.xp6(1),t.Q6J("ngIf",n.receiptTemplate&&1==n.printMode&&n.isPrintBIll),t.xp6(1),t.Q6J("ngIf",n.receiptTemplate&&2==n.printMode),t.xp6(1),t.Q6J("ngIf",n.parkMini))},dependencies:[p.O5,St.g,G.Y,V.t,Zt.Q],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.park-action[_ngcontent-%COMP%]{display:none}}.park-action[_ngcontent-%COMP%]{position:fixed;top:55%;transform:translateY(-50%);right:0}.park-action.fullscreen-button-right[_ngcontent-%COMP%]{right:0}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{width:68px;height:64px;cursor:pointer;outline:none;text-align:center;font-weight:700;font-family:Roboto Slab,serif;text-transform:uppercase;list-style:none;background-color:#89b03e;color:#fff;padding-top:23px;display:block}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(odd){border:1px solid #51632e}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(even){color:#545454;text-shadow:0 1px 0 white;background-color:#f4f4f4;font-weight:700;border-left:1px solid #a6a6a6;border-right:1px solid #a6a6a6}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #a6a6a6}@media (max-width: 575.98px){.park-action[_ngcontent-%COMP%]{z-index:1000}}.park[_ngcontent-%COMP%] .mat-mdc-tab-body-content{overflow:hidden!important;padding-top:15px}"]})),o})();var Tt=c(51467),_o=c(34915),It=c(40083),fo=c(45882),kt=c(10812),ho=c(86725),Co=c(87019);const bo=function(){return["/Print/TaxInvoice"]},At=function(o){return{ID:o}};function vo(o,s){if(1&o&&(t.TgZ(0,"a",49),t._uU(1,"Tax"),t.qZA()),2&o){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,bo))("queryParams",t.VKq(3,At,e.completeData.ObjectID))}}const xo=function(o,s){return{ID:o,Template:s}};function Po(o,s){if(1&o&&(t.TgZ(0,"a",50),t._uU(1,"Delivery Order"),t.qZA()),2&o){const e=t.oxw();t.Q6J("queryParams",t.WLB(1,xo,e.completeData.OutDeliveryID,e.outletInfo.PrintTemplate.ID))}}const Oo=function(o,s,e){return{InvoiceID:o,OutID:s,Template:e}};function yo(o,s){if(1&o&&(t.TgZ(0,"a",51),t._uU(1,"Invoice & Delivery Order"),t.qZA()),2&o){const e=t.oxw();t.Q6J("queryParams",t.kEZ(1,Oo,e.completeData.ObjectID,e.completeData.OutDeliveryID,e.outletInfo.PrintTemplate.ID))}}function Mo(o,s){if(1&o&&(t.TgZ(0,"a",52),t._uU(1,"Invoice (No Price)"),t.qZA()),2&o){const e=t.oxw();t.Q6J("href",e.getInvoicePrintURL(!0),t.LSH)}}const Do=function(o){return{ID:o,Print:1,Printer:"Normal"}};function So(o,s){if(1&o&&(t.TgZ(0,"a",53),t._uU(1,"Packing Slip"),t.qZA()),2&o){const e=t.oxw();t.Q6J("queryParams",t.VKq(1,Do,e.completeData.OutDeliveryID))}}function Zo(o,s){if(1&o&&(t.TgZ(0,"a",59),t._UZ(1,"i",60),t._uU(2,"Print Receipt "),t.qZA()),2&o){const e=t.oxw(3);t.Q6J("href",e.getInvoicePrintURL(!1),t.LSH)}}function To(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",61),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.print())}),t._UZ(1,"i",60),t._uU(2,"Print Receipt "),t.qZA()}}function Io(o,s){if(1&o&&(t.TgZ(0,"div",56),t.YNc(1,Zo,3,1,"a",57),t.YNc(2,To,3,0,"a",58),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.completeData),t.xp6(1),t.Q6J("ngIf",!e.completeData)}}function ko(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",56)(1,"button",62),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.generateLink())}),t._UZ(2,"i",63),t._uU(3,"Generate Payment Link "),t.qZA()()}}function Ao(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",56)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.verifyPaymentSettlement())}),t._UZ(2,"i",65),t._uU(3,"Verify Payment Settlement "),t.qZA()()}}function wo(o,s){if(1&o&&(t.TgZ(0,"div",12)(1,"div",54),t.YNc(2,Io,3,2,"div",55),t.YNc(3,ko,4,0,"div",55),t.YNc(4,Ao,4,0,"div",55),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("ngIf",e.role.Reprint),t.xp6(1),t.Q6J("ngIf",1==e.completeData.PaymentStateID),t.xp6(1),t.Q6J("ngIf",e.isNotEmpty(e.paymentGatewayService.getTransactionId()))}}function No(o,s){if(1&o&&(t.ynx(0),t.TgZ(1,"a",66),t._uU(2),t.qZA(),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("queryParams",t.VKq(2,At,e.completeData.ObjectID)),t.xp6(1),t.hij(" Invoice #",null==e.completeData?null:e.completeData.InvoiceNumber," ")}}function Jo(o,s){if(1&o&&(t.TgZ(0,"span",67),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.hij(" Invoice #",null==e.completeData?null:e.completeData.InvoiceNumber," ")}}function Uo(o,s){if(1&o&&(t.TgZ(0,"div",2)(1,"div",69),t._uU(2),t.qZA(),t.TgZ(3,"div",70),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&o){const e=s.$implicit;t.xp6(2),t.Oqu(e.Label),t.xp6(2),t.AsE(" ",e.CurrencySymbol," ",t.lcZ(5,3,e.Amount)," ")}}function Qo(o,s){if(1&o&&(t.TgZ(0,"div",8),t.YNc(1,Uo,6,5,"div",68),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.itemSummary)}}function qo(o,s){if(1&o&&(t.TgZ(0,"div",74)(1,"div",75),t._uU(2),t.qZA(),t.TgZ(3,"div",76),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&o){const e=s.$implicit,n=s.index,r=t.oxw(2);t.xp6(1),t.Q6J("hidden",!r.role.PriceVisible),t.xp6(1),t.AsE(" ",e.Label,": ",e.CurrencySymbol," "),t.xp6(1),t.Q6J("hidden",!r.role.PriceVisible)("ngClass",n+1===r.amountSummary.length?"amount":""),t.xp6(1),t.hij(" ",t.lcZ(5,6,e.Amount)," ")}}function Ro(o,s){if(1&o&&(t.TgZ(0,"div",74)(1,"div",75),t._uU(2),t.qZA(),t.TgZ(3,"div",77),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&o){const e=s.$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("hidden",!n.role.PriceVisible),t.xp6(1),t.AsE(" ",e.Label,": ",e.CurrencySymbol," "),t.xp6(1),t.Q6J("hidden",!n.role.PriceVisible),t.xp6(1),t.hij(" ",t.lcZ(5,5,e.Amount)," ")}}function Eo(o,s){if(1&o&&(t.TgZ(0,"div",71),t.YNc(1,qo,6,8,"div",72),t.TgZ(2,"div",73),t.YNc(3,Ro,6,7,"div",72),t.qZA()()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.amountSummary),t.xp6(2),t.Q6J("ngForOf",e.paymentSummary)}}function Fo(o,s){if(1&o&&(t.TgZ(0,"div",78)(1,"div",79)(2,"p",80),t._uU(3," INVALID AMOUNT CHARGE, CORRECT AMOUNT "),t.qZA(),t.TgZ(4,"P",81),t._uU(5),t.ALo(6,"number"),t.qZA()()()),2&o){const e=t.oxw();t.xp6(5),t.Oqu(t.lcZ(6,1,e.completeData.Final))}}function Yo(o,s){if(1&o&&(t.TgZ(0,"div",82)(1,"div",40)(2,"h3",41),t._uU(3,"Point Balance"),t.qZA()(),t._UZ(4,"div",83),t.qZA()),2&o){const e=t.oxw();t.xp6(4),t.Q6J("innerHtml",e.completeData.LoyaltyPoint,t.oJD)}}function Ho(o,s){if(1&o&&t._UZ(0,"pos-receipt",87),2&o){const e=t.oxw(2);t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.posStorage.AppConfigJSON)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletInfo)}}function Ko(o,s){if(1&o&&t._UZ(0,"pos-receipt-a4",88),2&o){const e=t.oxw(2);t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.posStorage.AppConfigJSON)("workOrderMode",!1)("outletInfo",e.outletInfo)}}function Lo(o,s){if(1&o&&(t.TgZ(0,"div",84),t.YNc(1,Ho,1,5,"pos-receipt",85),t.YNc(2,Ko,1,5,"pos-receipt-a4",86),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.receiptTemplate&&2==e.printMode),t.xp6(1),t.Q6J("ngIf",e.receiptTemplate&&1==e.printMode)}}const Bo=function(o){return{"bg-gradient-warning":o}};let $o=(()=>{class o{handleF8(){this.newSale()}get posStorage(){return this._posService.Data}constructor(e,n,r,a,l,m,f,C,O,y,q,R,rt,at,st,Ci,bi,vi,xi,Pi,Oi){(0,i.Z)(this,"_posDataService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_OrderHttpService",void 0),(0,i.Z)(this,"_PaymentHttpService",void 0),(0,i.Z)(this,"_receiptService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_toastr",void 0),(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"ref",void 0),(0,i.Z)(this,"_signalBroadCast",void 0),(0,i.Z)(this,"_calculatorService",void 0),(0,i.Z)(this,"_localDataService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_router",void 0),(0,i.Z)(this,"_receiptCalculatorService",void 0),(0,i.Z)(this,"datePipe",void 0),(0,i.Z)(this,"decimalPipe",void 0),(0,i.Z)(this,"paymentGatewayService",void 0),(0,i.Z)(this,"paymentHttpService",void 0),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"receiptTemplate",null),(0,i.Z)(this,"completeData",new _o.u),(0,i.Z)(this,"printMode",2),(0,i.Z)(this,"outletInfo",new _t.t),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"email",""),(0,i.Z)(this,"editAfterDelivery",!1),(0,i.Z)(this,"finalAmountDifferent",!1),(0,i.Z)(this,"amountSummary",[]),(0,i.Z)(this,"itemSummary",[]),(0,i.Z)(this,"paymentSummary",[]),(0,i.Z)(this,"orderManager",void 0),(0,i.Z)(this,"isOnline",!1),(0,i.Z)(this,"destroy$",new v.x),(0,i.Z)(this,"posState",void 0),(0,i.Z)(this,"isOrderDateNow",void 0),this._posDataService=e,this._posService=n,this._orderProcessorService=r,this._OrderHttpService=a,this._PaymentHttpService=l,this._receiptService=m,this._outletService=f,this._toastr=C,this._onlineStatusService=O,this._matDialog=y,this.ref=q,this._signalBroadCast=R,this._calculatorService=rt,this._localDataService=at,this._userRoleService=st,this._router=Ci,this._receiptCalculatorService=bi,this.datePipe=vi,this.decimalPipe=xi,this.paymentGatewayService=Pi,this.paymentHttpService=Oi}ngOnInit(){this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._posDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.outletInfo=e}),this._OrderHttpService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(()=>{this.itemSummary=this._receiptService.generateCartItemSummary(),this.amountSummary=this._receiptCalculatorService.generateAmountSummary(),this.paymentSummary=this._receiptService.generatePaymentSummary()}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.orderManager=e,this.posState=e.posState,this._OrderHttpService.Data&&(this.completeData=this._OrderHttpService.Data),this.checkOrderDateIsNow(),this.checkFinalAmountDifferent()}),this._onlineStatusService.getOnlineStatus$().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.isOnline=e}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e}),this._router.events.pipe((0,d.R)(this.destroy$)).subscribe(e=>{e instanceof b.OD&&(this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(g.J.IsNew))})}ngAfterViewInit(){this.posState==g.J.IsComplete&&(this.checkOrderNumber(),""==this.email&&null!=this.completeData.Contact&&this.isNotEmpty(this.completeData.Contact.Email)&&(this.email=this.completeData.Contact.Email),this.isOnline||this._toastr.warning(k.g.submitLocally,"Info!"),this.printMode=this.outletInfo.PrintTemplate.PrintMode,this.print(),this.ref.detectChanges())}checkOrderDateIsNow(){let e=this.completeData.OrderTimeString,n=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy");this.isOrderDateNow=e.includes(n)}checkFinalAmountDifferent(){if(this.posState==g.J.IsComplete){const n=this.completeData.Final;if(n-this._calculatorService.Data>this.posStorage.AppConfigJSON.ModuleSell.ToleranceAmount){this.finalAmountDifferent=!0;const m=this.decimalPipe.transform(n);setTimeout(()=>{this._toastr.warning(`Final Amount should be ${m}! Use Print Receipt to print the correct Receipt!`,"Invalid Amount charged",{timeOut:1e4})},500)}else this.finalAmountDifferent=!1}}checkOrderNumber(){this.completeData.InvoiceNumber!=this.posData.Order.Number&&(this._toastr.warning("Your invoice number is changed to "+this.completeData.InvoiceNumber,"Invoice Number Changed!"),this.posData.Order.Number=this.completeData.InvoiceNumber)}generateLink(){1==this.posStorage.AppConfigJSON.PaymentConfigLink&&this._matDialog.open(It.z),this._PaymentHttpService.generateLink({InvoiceID:this.completeData.ObjectID}).subscribe({next:n=>{this._matDialog.open(It.z,{data:{link:n.token.redirect_url}})},error:n=>{this._toastr.error(n.Message,"Couldn't generate link!")}})}newSale(){try{this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(g.J.IsNew),this._router.navigate([],{queryParams:{ID:null}})}catch(e){console.error(e),this._toastr.error(e,"Error redirecting to NEW mode")}}shelve(){const e=this._OrderHttpService.generatePOSDataForSubmission(this.posData);this._localDataService.syncOrder(e).subscribe(()=>{this.newSale()})}retrySubmit(){this._posDataService.pushNewValue(this.posData),this._posDataService.submitOrder(this.posStorage.AppConfigJSON).then(e=>{e.Success?(this._signalBroadCast.BroadcastStateToCustomerDisplay(g.J.IsComplete,e.ObjectID,e.LoyaltyPoint,this.posData.TotalPaidAmount-this._calculatorService.Data),this._posDataService.pushNewValue(this.posData),this._orderProcessorService.updatePosState(g.J.IsComplete,e)):(this._posDataService.pushNewValue(this.posData),this._orderProcessorService.updatePosState(g.J.IsComplete,e))})}getInvoicePrintURL(e){let r="";return e&&(r="&Print=1&Price=0"),u.gT.StringFormat("{0}?ID={1}&Template={2}{3}","/print/Invoice"+(2===this.outletInfo.PrintTemplate.PrintMode?"Mini":""),this.completeData.ObjectID,this.outletInfo.PrintTemplate.ID,r)}sendEmail(){null!=this.email&&0!=this.email.length||(this.email=document.getElementById("contactEmail").value,""!=this.email)?this._OrderHttpService.sendEmail(this.email,this.completeData.ObjectID).then(e=>{this._toastr.success(e.Message,"Email sent!")}):this._toastr.error("Please enter email before sending receipt!","No email")}print(){this.isOnline||(this.printMode=2,this._toastr.info("Could not print in A4 format due to network connectivity","Can't Print A4 Format!")),2==this.printMode?this.printReceiptMini():1==this.printMode&&this.printReceiptA4(),this.posStorage.AppConfigJSON.ModuleSell.Printing.PrintOnPayment&&this.printWindow()}printReceiptMini(){this.receiptTemplate=this._receiptService.generateReceiptMini()}printReceiptA4(){this._OrderHttpService.generateReceiptA4(this.completeData.ObjectID).subscribe({next:e=>{this.receiptTemplate=e.Data},error:e=>{this._toastr.error("Could not print in A4 format!\nPrinting in 8mm format instead!","Error!"),this.printReceiptMini()}})}printWindow(){this.finalAmountDifferent||setTimeout(()=>{window.print()},700)}isNotEmpty(e){return u.gT.IsNotEmpty(e)}updateEmail(e){this.email=e}verifyPaymentSettlement(){let e=new fo.r;e.Amount=this.completeData.Final,e.TransactionID=this.paymentGatewayService.getTransactionId(),e.RegisterID=this._outletService.Data.RegisterID,e.Number=this.posData.Order.Number,this.paymentHttpService.VerifyPayment(e).pipe((0,d.R)(this.destroy$)).subscribe({next:n=>{this._toastr.success(n.Message,"QR Settlement")}})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(S.q),t.Y36(x.W),t.Y36(M.d),t.Y36(j.D),t.Y36(kt.q),t.Y36(Dt.V),t.Y36(P.o),t.Y36(U._W),t.Y36(J.q),t.Y36(h.uw),t.Y36(t.sBO),t.Y36(ho.j),t.Y36(H.J),t.Y36(W.T),t.Y36(T.J),t.Y36(b.F0),t.Y36(Co.i),t.Y36(p.uU),t.Y36(p.JJ),t.Y36(ct.i),t.Y36(kt.q))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-complete"]],hostBindings:function(e,n){1&e&&t.NdJ("keydown.F8",function(a){return n.handleF8(a)},!1,t.Jf7)},decls:65,vars:21,consts:[[1,"sell-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-md-8"],[1,"card",3,"hidden"],[1,"card-header","alert-danger"],[1,"d-flex","justify-content-between"],[1,"fa-solid","fa-xmark-circle","me-1","text-danger"],[1,"card-body"],[1,"row","mt-9","justify-content-center","g-0","mb-9"],[1,"col-5","text-center"],["type","button","matTooltipPosition","above","matTooltip","Try uploading order to the server again",1,"btn","btn-success","btn-lg",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-floppy-disk","me-2",2,"font-size","14px"],[1,"card-header",3,"ngClass"],[1,"fa-solid","fa-check","me-1"],[1,"fst-italic"],[1,"dropdown"],["type","button","id","dropdownMenuButton","data-bs-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","dropdown-toggle"],["aria-labelledby","dropdownMenuButton",1,"dropdown-menu","dropdown-menu-end"],["class","dropdown-item","target","_blank",3,"routerLink","queryParams",4,"ngIf"],["class","dropdown-item","routerLink","/print/OutDelivery","target","_blank",3,"queryParams",4,"ngIf"],["class","dropdown-item","routerLink","/print/InvoiceNOutD","target","_blank",3,"queryParams",4,"ngIf"],["class","dropdown-item","target","_blank",3,"href",4,"ngIf"],["class","dropdown-item","routerLink","/print/PackingSlip","target","_blank",3,"queryParams",4,"ngIf"],[1,"container"],[1,"row","border-bottom","align-items-center","g-0","mt-5"],[1,"col-auto","px-2"],[1,"fa-solid","fa-envelope","fa-lg"],[1,"col"],["placeholder","Email Receipt","inputID","contactEmail","requestUrl","/API/AC/GetEmailSuggestion",1,"border-0","w-100",3,"inputTextValue","onSelect"],[1,"col-auto","pe1"],["type","button",1,"btn","btn-light-gray",3,"click"],[1,"col-10","text-center"],["type","button",1,"btn","btn-success","btn-lg","w-100",3,"click"],["class","card-footer bg-light-gray",4,"ngIf"],[1,"col-md-4"],[1,"card-header","bg-light-gray"],[1,"text-dark"],[4,"ngIf","ngIfElse"],["OFFLINE",""],["class","card-body",4,"ngIf"],["class","card-footer bg-white",4,"ngIf"],["class","card-footer bg-gradient-warning",4,"ngIf"],["class","card",4,"ngIf"],["class","print_containers",4,"ngIf"],["target","_blank",1,"dropdown-item",3,"routerLink","queryParams"],["routerLink","/print/OutDelivery","target","_blank",1,"dropdown-item",3,"queryParams"],["routerLink","/print/InvoiceNOutD","target","_blank",1,"dropdown-item",3,"queryParams"],["target","_blank",1,"dropdown-item",3,"href"],["routerLink","/print/PackingSlip","target","_blank",1,"dropdown-item",3,"queryParams"],[1,"row","justify-content-between"],["class","col-auto my-6",4,"ngIf"],[1,"col-auto","my-6"],["target","_blank","class","btn btn-light-gray",3,"href",4,"ngIf"],["class","btn btn-light-gray",3,"click",4,"ngIf"],["target","_blank",1,"btn","btn-light-gray",3,"href"],[1,"fa-solid","fa-print","me-2"],[1,"btn","btn-light-gray",3,"click"],["type","button","data-cy","payment-link",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-money-bill-wave","me-2"],["type","button","data-cy","verify-payment-settelment",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-circle-check","me-2"],["target","_blank","routerLink","/menu/Orders/Orders/Customer_Invoice/Info",1,"text-dark","fst-italic",3,"queryParams"],[1,"text-dark","fst-italic"],["class","row",4,"ngFor","ngForOf"],[1,"col-8"],[1,"col-4","text-end"],[1,"card-footer","bg-white"],["class","d-flex justify-content-end","style","line-height: 30px;",4,"ngFor","ngForOf"],[1,"border-top"],[1,"d-flex","justify-content-end",2,"line-height","30px"],[1,"text-end",3,"hidden"],[1,"text-end","w-50",3,"hidden","ngClass"],[1,"text-end","w-50",3,"hidden"],[1,"card-footer","bg-gradient-warning"],[1,"text-end"],[1,"fw-bold"],[1,"text-danger",2,"font-size","38px"],[1,"card"],[1,"card-body","pb-0","text-center",3,"innerHtml"],[1,"print_containers"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo",4,"ngIf"],[3,"data","printTemplate","config","workOrderMode","outletInfo",4,"ngIf"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo"],[3,"data","printTemplate","config","workOrderMode","outletInfo"]],template:function(e,n){if(1&e&&(t.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"h2"),t._UZ(8,"i",7),t._uU(9," Order Upload Fail! "),t.qZA()()(),t.TgZ(10,"div",8)(11,"div",9)(12,"div",10)(13,"button",11),t.NdJ("click",function(){return n.retrySubmit()}),t._uU(14," Retry Upload "),t.qZA()()()(),t.TgZ(15,"div",12)(16,"div",13)(17,"div",14)(18,"button",15),t.NdJ("click",function(){return n.shelve()}),t._UZ(19,"i",16),t._uU(20,"Save Offline "),t.qZA()()()()(),t.TgZ(21,"div",4)(22,"div",17)(23,"div",6)(24,"h2"),t._UZ(25,"i",18),t._uU(26," Sell Complete "),t.TgZ(27,"small",19),t._uU(28),t.qZA()(),t.TgZ(29,"div")(30,"div",20),t._UZ(31,"button",21),t.TgZ(32,"div",22),t.YNc(33,vo,2,5,"a",23),t.YNc(34,Po,2,4,"a",24),t.YNc(35,yo,2,5,"a",25),t.YNc(36,Mo,2,1,"a",26),t.YNc(37,So,2,3,"a",27),t.qZA()()()()(),t.TgZ(38,"div",8)(39,"div",28)(40,"div",29)(41,"div",30),t._UZ(42,"i",31),t.qZA(),t.TgZ(43,"div",32)(44,"autocompleteV2",33),t.NdJ("onSelect",function(a){return n.updateEmail(a)}),t.qZA()(),t.TgZ(45,"div",34)(46,"a",35),t.NdJ("click",function(){return n.sendEmail()}),t._uU(47,"Send Receipt"),t.qZA()()(),t.TgZ(48,"div",9)(49,"div",36)(50,"button",37),t.NdJ("click",function(){return n.newSale()}),t._uU(51," New Sale (F8) "),t.qZA()()()()(),t.YNc(52,wo,5,3,"div",38),t.qZA()(),t.TgZ(53,"div",39)(54,"div",4)(55,"div",40)(56,"h3",41),t.YNc(57,No,3,4,"ng-container",42),t.YNc(58,Jo,2,1,"ng-template",null,43,t.W1O),t.qZA()(),t.YNc(60,Qo,2,1,"div",44),t.YNc(61,Eo,4,2,"div",45),t.YNc(62,Fo,7,3,"div",46),t.qZA(),t.YNc(63,Yo,5,1,"div",47),t.qZA()()()(),t.YNc(64,Lo,3,2,"div",48)),2&e){const r=t.MAs(59);t.xp6(4),t.Q6J("hidden",1==n.posState),t.xp6(17),t.Q6J("hidden",9==n.posState),t.xp6(1),t.Q6J("ngClass",t.VKq(19,Bo,!n.isOrderDateNow||n.completeData.PaymentStateID<3)),t.xp6(6),t.hij(" (",n.completeData.PaymentStateLabel,")"),t.xp6(5),t.Q6J("ngIf",n.completeData),t.xp6(1),t.Q6J("ngIf",n.completeData.OutDeliveryID),t.xp6(1),t.Q6J("ngIf",n.completeData.OutDeliveryID),t.xp6(1),t.Q6J("ngIf",n.completeData),t.xp6(1),t.Q6J("ngIf",n.completeData.OutDeliveryID),t.xp6(7),t.Q6J("inputTextValue",n.email),t.xp6(8),t.Q6J("ngIf",n.isOnline),t.xp6(2),t.Q6J("hidden",9==n.posState),t.xp6(3),t.Q6J("ngIf",n.isOnline)("ngIfElse",r),t.xp6(3),t.Q6J("ngIf",n.itemSummary),t.xp6(1),t.Q6J("ngIf",!n.finalAmountDifferent),t.xp6(1),t.Q6J("ngIf",n.finalAmountDifferent),t.xp6(1),t.Q6J("ngIf",n.completeData.LoyaltyPoint),t.xp6(1),t.Q6J("ngIf",n.outletInfo)}},dependencies:[p.mk,p.sg,p.O5,b.rH,A.J,V.t,G.Y,p.JJ],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.sell-complete[_ngcontent-%COMP%]{display:none}}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container{max-width:500px;margin-top:30px;margin-bottom:30px}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] mat-form-field input.form-control{border:none;font-size:16px;padding-left:2px}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] mat-form-field input.form-control:focus{border:none}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] [type=button]{-webkit-appearance:initial}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] input{font-size:1rem}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .btn-success{padding:.5rem 1rem;font-size:1.25rem}.sell-complete[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px}"]})),o})();function Go(o,s){if(1&o&&t._UZ(0,"pos-header",4),2&o){const e=t.oxw();t.Q6J("isOnline",e.isOnline)}}function Vo(o,s){1&o&&t._UZ(0,"pos-sidebutton")}function zo(o,s){if(1&o&&(t.ynx(0),t._UZ(1,"pos-toolbar"),t.TgZ(2,"div",8)(3,"div",9),t._UZ(4,"pos-quick-key"),t.qZA(),t.TgZ(5,"div",10),t._UZ(6,"pos-cart"),t.qZA()(),t.YNc(7,Vo,1,0,"pos-sidebutton",11),t.BQk()),2&o){const e=t.oxw(2);t.xp6(7),t.Q6J("ngIf",e.isOnline)}}function jo(o,s){1&o&&(t.TgZ(0,"div"),t._UZ(1,"pos-complete"),t.qZA())}function Wo(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div")(1,"h4",12),t._UZ(2,"i",13),t.TgZ(3,"span",14),t._uU(4,"Commission for order"),t.qZA(),t.TgZ(5,"a",15)(6,"small",16),t._uU(7),t.qZA()()(),t.TgZ(8,"commission-cart",17),t.NdJ("onSaved",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onCommissionSaved())})("onBack",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.orderManager.CommissionID=null)}),t.qZA()()}if(2&o){const e=t.oxw(3);t.xp6(7),t.hij("#",null==e.submitOrderData?null:e.submitOrderData.InvoiceNumber,""),t.xp6(1),t.Q6J("soid",e.orderManager.CommissionID)("listSales",e.outletInfo.ListSales)}}function Xo(o,s){if(1&o&&(t.YNc(0,jo,2,0,"div",11),t.YNc(1,Wo,9,3,"div",11)),2&o){const e=t.oxw(2);t.Q6J("ngIf",!e.orderManager.CommissionID),t.xp6(1),t.Q6J("ngIf",e.orderManager.CommissionID)}}function ti(o,s){if(1&o&&(t.TgZ(0,"div",5),t.YNc(1,zo,8,1,"ng-container",6),t.YNc(2,Xo,2,2,"ng-template",null,7,t.W1O),t.qZA()),2&o){const e=t.MAs(3),n=t.oxw();t.xp6(1),t.Q6J("ngIf",n.IsNotCompleteOrFailed())("ngIfElse",e)}}let ei=(()=>{class o extends Et.M{constructor(e,n,r,a,l,m,f,C,O,y,q,R,rt,at,st){super(r),(0,i.Z)(this,"dialogRef",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_httpService",void 0),(0,i.Z)(this,"_OrderHttpService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_route",void 0),(0,i.Z)(this,"_signalRClientService",void 0),(0,i.Z)(this,"_toastr",void 0),(0,i.Z)(this,"_paymentServiceGateway",void 0),(0,i.Z)(this,"_numpadService",void 0),(0,i.Z)(this,"userRoleService",void 0),(0,i.Z)(this,"roleService",void 0),(0,i.Z)(this,"posHttpResponse",void 0),(0,i.Z)(this,"isOnline",!0),(0,i.Z)(this,"posState",void 0),(0,i.Z)(this,"commissionID",void 0),(0,i.Z)(this,"outletInfo",void 0),(0,i.Z)(this,"orderManager",void 0),(0,i.Z)(this,"submitOrderData",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"decimalPipe",void 0),(0,i.Z)(this,"invoiceNumberEdit",void 0),this.dialogRef=e,this._posService=n,this._httpService=r,this._OrderHttpService=a,this._orderProcessorService=l,this._outletService=m,this._onlineStatusService=f,this._route=C,this._signalRClientService=O,this._toastr=y,this._paymentServiceGateway=q,this._numpadService=R,this.userRoleService=rt,this.roleService=at,this.destroy$=new v.x,this.decimalPipe=new p.JJ(st)}ngOnInit(){this.menuData$.pipe((0,d.R)(this.destroy$)).subscribe(()=>{this._posService.request().then(e=>{if(this.posHttpResponse=e,this.subscribeToObservableChanges(),this.checkClientTime(),this._route.snapshot.queryParamMap.has("ID")){const n=this._route.snapshot.queryParamMap.get("ID");this.editInvoice(n)}else this._outletService.setActiveRegisterFromOptions(e.Registers,e.UserName);this.initializeRole()})})}initializeRole(){const e=new Ft.Q(this.roleService);this.userRoleService.pushNewValue(e)}onQRPaymentComplete(e){if(!u.gT.IsEmpty(e)){const n=JSON.parse(e);this._paymentServiceGateway.onQRPaymentComplete(n,this.posHttpResponse.AppConfigJSON).then(r=>{this.dialogRef.getDialogById("ModalPayment").close();const m=`IDR ${this.decimalPipe.transform(n.gross_amount)} received. Please verify in customer mobile app!`;this._toastr.success(m," QR Settlement"),this._orderProcessorService.updatePosState(g.J.IsComplete,r)}).catch(r=>{this._toastr.error(r.message,r.header?r.header:"Error")})}}editInvoice(e){this._orderProcessorService.updatePosState(g.J.IsEdit),this._OrderHttpService.GetInvoiceBySoID(e).pipe((0,d.R)(this.destroy$)).subscribe(n=>{this.invoiceNumberEdit=n.Invoice.Number,n.Invoice.Number=null,this._orderProcessorService.plainToClass(n),this.syncPageHeaderLabel(g.J.IsEdit)})}subscribeToObservableChanges(){this._onlineStatusService.getOnlineStatus$().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.isOnline=e}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.orderManager=e,this.submitOrderData=this._OrderHttpService.Data,this.posState=e.posState,this.syncPageHeaderLabel(this.posState)}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.outletInfo=e}),this._signalRClientService.OnPaymentReceived.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.onQRPaymentComplete(e)})}IsNotCompleteOrFailed(){let e;switch(this.posState){case g.J.IsComplete:case g.J.UploadOrderFail:e=!1;break;default:e=!0}return e}syncPageHeaderLabel(e){switch(e){case g.J.IsEdit:this.invoiceNumberEdit&&(this.menuData.H=`Editing Order#${this.invoiceNumberEdit}`);break;case g.J.IsComplete:this.menuData.H=u.gT.IsEmpty(this.orderManager.CommissionID)?"Order Complete":"New Sale Order";break;default:this.menuData.H="New Sale Order"}}onCommissionSaved(){this.orderManager.CommissionID=null}checkClientTime(){let e=new Date(this.posHttpResponse.ServerDateString),n=new Date;e.getDate()!==n.getDate()&&this._toastr.warning("Client date is not equal with Server Date",z.n.Warning)}ngOnDestroy(){this._numpadService.destroy(),this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(h.uw),t.Y36(x.W),t.Y36(Yt.O),t.Y36(j.D),t.Y36(M.d),t.Y36(P.o),t.Y36(J.q),t.Y36(b.gz),t.Y36(Ht.G),t.Y36(U._W),t.Y36(ct.i),t.Y36(Kt.u),t.Y36(T.J),t.Y36(Lt.N),t.Y36(t.soG))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos"]],features:[t.qOj],decls:6,vars:7,consts:[["rel","stylesheet","href","/Styles/Master/app_custom.css"],[3,"hideSearchDropdown","hideSearchBox","offline","pageData","hideMoreMenu"],[3,"isOnline",4,"ngIf"],["class","container-fluid",4,"ngIf"],[3,"isOnline"],[1,"container-fluid"],[4,"ngIf","ngIfElse"],["complete",""],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[1,"col-auto","cart"],[4,"ngIf"],[1,"text-link","my-8"],["aria-hidden","true",1,"fa-solid","fa-arrows-rotate"],[1,"text-primary","fw-bold","h4"],[1,"text-dark","fs-10","fst-italic"],[1,"text-muted"],[3,"soid","listSales","onSaved","onBack"]],template:function(e,n){1&e&&(t._UZ(0,"link",0),t.TgZ(1,"mainpanel-cmp",1)(2,"actions"),t.YNc(3,Go,1,1,"pos-header",2),t.qZA(),t.TgZ(4,"content"),t.YNc(5,ti,4,2,"div",3),t.qZA()()),2&e&&(t.xp6(1),t.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("offline",!n.isOnline)("pageData",n.menuData)("hideMoreMenu",1==n.posState),t.xp6(2),t.Q6J("ngIf",n.posHttpResponse&&n.IsNotCompleteOrFailed()),t.xp6(2),t.Q6J("ngIf",n.posHttpResponse))},dependencies:[p.O5,pe,Je,Nn,Gn,Mt.p,mo,Tt.W,$o],styles:['@media print{.cashier[_ngcontent-%COMP%], pos-quick-key[_ngcontent-%COMP%], pos-header[_ngcontent-%COMP%], pos-toolbar[_ngcontent-%COMP%]{display:none}}.quickKey[_ngcontent-%COMP%]{margin-right:10px}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-webkit-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-ms-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.quickKey[_ngcontent-%COMP%]{width:420px;margin-right:10px}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.cart[_ngcontent-%COMP%]{width:570px}@media only screen and (max-width: 1280px){input[id=ContactID][_ngcontent-%COMP%]{width:135px}}@media only screen and (max-width: 1215px){input[id=ContactID][_ngcontent-%COMP%]{width:120px}}@media only screen and (max-width: 1185px){input[id=ContactID][_ngcontent-%COMP%]{width:140px}} .hg-theme-default .hg-button{height:70px!important;font-size:16px!important} .hg-button-bksp{width:21px} .hg-button[data-skbtn="{enter}"][_ngcontent-%COMP%]{width:90px}']})),o})();var wt=c(35510);const ni=[{path:"",component:ei},{path:"V3",component:wt.SellV3Component},{path:"**",redirectTo:"",pathMatch:"full"}];let oi=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[b.Bz.forChild(ni),b.Bz]})),o})();var Nt=c(71948),Jt=c(90811),ii=c(4859);let ri=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[p.ez,I.d,Nt.Fk,_.u5,N.Nh,Z.dr,Jt.vV,oe,D.AV,ii.ot]})),o})();var it=c(65131),Ut=c(94673);let ai=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[p.ez,et.ZU,Z.dr,_.u5,I.d,$.A0,it.X,A.Q,nt.q,D.AV,Ut.z,Nt.Fk]})),o})(),Qt=(()=>{class o{transform(e,n,...r){return e.filter(a=>!n.includes(a.ID))}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275pipe",t.Yjl({name:"payment",type:o,pure:!0})),o})();var si=c(14650),ci=c(12386),li=c(70585),di=c(54825),pi=c(945),ui=c(78639),gi=c(5536);let mi=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({providers:[Qt],imports:[p.ez,$.A0,w.Tx,_.u5,I.d,et.ZU,N.Nh,Z.dr,B._t,it.X,si.r,ci.S,A.Q,Jt.vV,li._8,b.Bz,nt.q,ot.JX,di.O,Ut.z,D.AV,pi.M,ui.g,gi.E]})),o})(),_i=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[p.ez,b.Bz,_.u5,$.A0,N.Nh,I.d,Z.dr,St.I,G.o,V.e,it.X,Zt.y]})),o})(),qt=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({providers:[Ot],imports:[p.ez,N.Nh,Z.dr,b.Bz]})),o})();var fi=c(64425);let hi=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({providers:[Qt],imports:[p.ez,_.u5,_.UX,oi,ri,ai,mi,qt,Mt.R,qt,Z.dr,A.Q,V.e,G.o,_i,Tt.$,I.d,fi.Iq,wt.SellV3Component]})),o})()}}]);
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[9757],{11989:(Rt,E,c)=>{c.d(E,{AM:()=>p});var i=c(81180);class p{constructor(){(0,i.Z)(this,"ID",void 0),(0,i.Z)(this,"TypeID",void 0),(0,i.Z)(this,"Groups",void 0),(0,i.Z)(this,"Items",void 0)}}},19757:(Rt,E,c)=>{c.r(E),c.d(E,{POSModule:()=>hi});var i=c(81180),p=c(36895),b=c(9116),t=c(94650),v=c(77579),g=c(99865),d=c(82722),Et=c(22863),u=c(67327),z=c(96700),Ft=c(90287),h=c(65412),x=c(67347),Yt=c(89156),j=c(77091),M=c(12227),P=c(10832),J=c(29099),Ht=c(71638),U=c(97185),ct=c(58908),Kt=c(25873),T=c(38933),Lt=c(51161),Bt=c(77814),lt=c(42046),Q=(()=>{return(o=Q||(Q={}))[o.STATUS=0]="STATUS",o[o.CONFIG=1]="CONFIG",Q;var o})(),W=c(13337),I=c(63165),_=c(24006);function $t(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",8)(2,"div",3)(3,"div",9)(4,"div",10),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.updateOnlineStatus(!1))}),t.TgZ(5,"label",11),t._UZ(6,"i",12),t.TgZ(7,"h4",13)(8,"strong"),t._uU(9,"ONLINE"),t.qZA()(),t.TgZ(10,"small",14),t._uU(11," Upload orders in realtime to cloud server "),t.qZA()()(),t.TgZ(12,"div",15),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.updateOnlineStatus(!0))}),t.TgZ(13,"label",16),t._UZ(14,"i",17),t.TgZ(15,"h4",18)(16,"strong"),t._uU(17,"OFFLINE"),t.qZA()(),t.TgZ(18,"small",14),t._uU(19," Save order locally, upload manually when connection is available "),t.qZA()()()()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(5),t.ekj("success",!(e.offlineConfig.orderUsingLocal&&e.offlineConfig.productUsingLocal&&e.offlineConfig.configUsingLocal)),t.xp6(8),t.ekj("offline",e.offlineConfig.orderUsingLocal&&e.offlineConfig.productUsingLocal&&e.offlineConfig.configUsingLocal)}}function Gt(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",8)(2,"div",3)(3,"div",20)(4,"div",21),t._uU(5,"Orders"),t.qZA(),t.TgZ(6,"div",21)(7,"input",22),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.orderUsingLocal=r)}),t.qZA(),t.TgZ(8,"label",23),t._uU(9,"Online"),t.qZA()(),t.TgZ(10,"div",21)(11,"input",22),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.orderUsingLocal=r)}),t.qZA(),t.TgZ(12,"label",23),t._uU(13,"Offline"),t.qZA()()(),t.TgZ(14,"div",20)(15,"div",21),t._uU(16,"Products"),t.qZA(),t.TgZ(17,"div",21)(18,"input",24),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.productUsingLocal=r)}),t.qZA(),t.TgZ(19,"label",23),t._uU(20,"Online"),t.qZA()(),t.TgZ(21,"div",21)(22,"input",24),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.productUsingLocal=r)}),t.qZA(),t.TgZ(23,"label",23),t._uU(24,"Offline"),t.qZA()()(),t.TgZ(25,"div",20)(26,"div",21),t._uU(27,"Start Config"),t.qZA(),t.TgZ(28,"div",21)(29,"input",25),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.configUsingLocal=r)}),t.qZA(),t.TgZ(30,"label",23),t._uU(31,"Online"),t.qZA()(),t.TgZ(32,"div",21)(33,"input",25),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.offlineConfig.configUsingLocal=r)}),t.qZA(),t.TgZ(34,"label",23),t._uU(35,"Offline"),t.qZA()()()()(),t.BQk()}if(2&o){const e=t.oxw(2);t.xp6(7),t.Q6J("ngModel",e.offlineConfig.orderUsingLocal)("value",!1),t.xp6(4),t.Q6J("ngModel",e.offlineConfig.orderUsingLocal)("value",!0),t.xp6(7),t.Q6J("ngModel",e.offlineConfig.productUsingLocal)("value",!1),t.xp6(4),t.Q6J("ngModel",e.offlineConfig.productUsingLocal)("value",!0),t.xp6(7),t.Q6J("ngModel",e.offlineConfig.configUsingLocal)("value",!1),t.xp6(4),t.Q6J("ngModel",e.offlineConfig.configUsingLocal)("value",!0)}}function Vt(o,s){if(1&o&&t.YNc(0,Gt,36,12,"ng-container",19),2&o){const e=t.oxw();t.Q6J("ngIf",e.offlineConfig)}}const dt=function(o){return{selected:o}};let zt=(()=>{class o{constructor(e,n,r){(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"dialogRef",void 0),(0,i.Z)(this,"indexDbService",void 0),(0,i.Z)(this,"modalConfig",new lt.O),(0,i.Z)(this,"offlineConfig",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"tabState",Q),(0,i.Z)(this,"currentTabState",Q.STATUS),this._onlineStatusService=e,this.dialogRef=n,this.indexDbService=r,this.modalConfig.title="Working Status",this.destroy$=new v.x,this.modalConfig.customWidth="420px"}ngOnInit(){this._onlineStatusService.offlineConfig$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.offlineConfig=e})}updateOnlineStatus(e){this.offlineConfig.configUsingLocal=e,this.offlineConfig.orderUsingLocal=e,this.offlineConfig.productUsingLocal=e}onCancel(){this.dialogRef.close()}onSave(){this.indexDbService.updateOfflineConfig(this.offlineConfig).pipe((0,d.R)(this.destroy$)).subscribe({next:e=>{this._onlineStatusService.pushNewValue(this.offlineConfig),this.dialogRef.close()},error:e=>{console.error(e,"Error")}})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(J.q),t.Y36(h.so),t.Y36(W.T))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-modal-online-status"]],decls:12,vars:9,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container-fluid"],[1,"row","border-bottom"],[1,"col-12"],["data-cy","point",1,"btn","btn-link-tab",3,"ngClass","click"],["data-cy","invoice",1,"btn","btn-link-tab",3,"ngClass","click"],[4,"ngIf","ngIfElse"],["CONFIG",""],[1,"row","mt-8"],[1,"row","g-0","text-center"],[1,"col-6","pe-3",3,"click"],[1,"btn","btn-outline-secondary","success"],[1,"fa","fa-wifi"],[1,"pt-5","pb-10"],[1,"h6"],[1,"col-6","ps-3",3,"click"],["for","radOffline",1,"btn","btn-outline-secondary","danger"],[1,"fa","fa-wifi-off"],[1,"pt-3"],[4,"ngIf"],[1,"row"],[1,"col-md-4"],["type","radio","name","order",3,"ngModel","value","ngModelChange"],[1,"fw-bold"],["type","radio","name","product",3,"ngModel","value","ngModelChange"],["type","radio","name","config",3,"ngModel","value","ngModelChange"]],template:function(e,n){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onSave()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"a",4),t.NdJ("click",function(){return n.currentTabState=n.tabState.STATUS}),t._uU(6," Status "),t.qZA(),t.TgZ(7,"a",5),t.NdJ("click",function(){return n.currentTabState=n.tabState.CONFIG}),t._uU(8," Config "),t.qZA()()(),t.YNc(9,$t,20,4,"ng-container",6),t.YNc(10,Vt,1,1,"ng-template",null,7,t.W1O),t.qZA()()()),2&e){const r=t.MAs(11);t.Q6J("config",n.modalConfig),t.xp6(5),t.Q6J("ngClass",t.VKq(5,dt,n.tabState.STATUS==n.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(7,dt,n.tabState.CONFIG==n.currentTabState)),t.xp6(2),t.Q6J("ngIf",n.tabState.STATUS==n.currentTabState)("ngIfElse",r)}},dependencies:[p.mk,p.O5,I.M,_.Fj,_._,_.JJ,_.On],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.success[_ngcontent-%COMP%]{color:#fff;background-color:#89b03e}.offline[_ngcontent-%COMP%]{color:#fff;background-color:#c9302c}.fa-wifi-off[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/v1535431932/POS/Images/Icon/wifi-off.svg);height:30px;width:30px;background-size:30px;background-repeat:no-repeat}#radOffline[_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%] .fa-wifi-off[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/wifi-off-white.svg)}.fa-wifi[_ngcontent-%COMP%]{font-size:30px}"]})),o})();var pt=c(11113),jt=c(79098),Wt=c(92408),Xt=c(43111),X=c(43225),tt=c(3238),ut=c(12693),gt=c(21281);let te=0;const ee=(0,tt.Id)(class{}),mt="mat-badge-content";let ne=(()=>{class o extends ee{get color(){return this._color}set color(e){this._setColor(e),this._color=e}get overlap(){return this._overlap}set overlap(e){this._overlap=(0,gt.Ig)(e)}get content(){return this._content}set content(e){this._updateRenderedContent(e)}get description(){return this._description}set description(e){this._updateHostAriaDescription(e)}get hidden(){return this._hidden}set hidden(e){this._hidden=(0,gt.Ig)(e)}constructor(e,n,r,a,l){super(),this._ngZone=e,this._elementRef=n,this._ariaDescriber=r,this._renderer=a,this._animationMode=l,this._color="primary",this._overlap=!0,this.position="above after",this.size="medium",this._id=te++,this._isInitialized=!1}isAbove(){return-1===this.position.indexOf("below")}isAfter(){return-1===this.position.indexOf("before")}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&this._renderer.destroyNode(this._badgeElement),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_createBadgeElement(){const e=this._renderer.createElement("span"),n="mat-badge-active";return e.setAttribute("id",`mat-badge-content-${this._id}`),e.setAttribute("aria-hidden","true"),e.classList.add(mt),"NoopAnimations"===this._animationMode&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),"function"==typeof requestAnimationFrame&&"NoopAnimations"!==this._animationMode?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(n)})}):e.classList.add(n),e}_updateRenderedContent(e){const n=`${e??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateHostAriaDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),e&&this._ariaDescriber.describe(this._elementRef.nativeElement,e),this._description=e}_setColor(e){const n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),e&&n.add(`mat-badge-${e}`)}_clearExistingBadges(){const e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${mt}`);for(const n of Array.from(e))n!==this._badgeElement&&n.remove()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(t.R0b),t.Y36(t.SBq),t.Y36(ut.$s),t.Y36(t.Qsj),t.Y36(t.QbO,8))},o.\u0275dir=t.lG2({type:o,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(e,n){2&e&&t.ekj("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small","small"===n.size)("mat-badge-medium","medium"===n.size)("mat-badge-large","large"===n.size)("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{disabled:["matBadgeDisabled","disabled"],color:["matBadgeColor","color"],overlap:["matBadgeOverlap","overlap"],position:["matBadgePosition","position"],content:["matBadge","content"],description:["matBadgeDescription","description"],size:["matBadgeSize","size"],hidden:["matBadgeHidden","hidden"]},features:[t.qOj]}),o})(),oe=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[ut.rt,tt.BQ,tt.BQ]}),o})();var D=c(10266);function ie(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openReturnModal())}),t.TgZ(2,"a",9),t._UZ(3,"i",10),t.ALo(4,"async"),t.qZA(),t.TgZ(5,"div",11)(6,"span",12),t._uU(7,"Return"),t.qZA()()()()}if(2&o){const e=t.oxw();t.xp6(3),t.Q6J("matBadgeHidden",t.lcZ(4,1,e.orderProcessorService.Data$).posState!==e.posState.IsReturn)}}function re(o,s){if(1&o&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Oqu(e.totalEligiblePromotion)}}function ae(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openPromotionModal())}),t.TgZ(2,"a",13),t._UZ(3,"i",14),t.qZA(),t.TgZ(4,"div",15)(5,"span",12),t._uU(6,"Promotion"),t.qZA(),t.YNc(7,re,2,1,"span",16),t.qZA()()()}if(2&o){const e=t.oxw();t.xp6(7),t.Q6J("ngIf",0!=e.totalEligiblePromotion)}}function se(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openSerialModal())}),t.TgZ(2,"a",18),t._UZ(3,"i",19),t.qZA(),t.TgZ(4,"div",15)(5,"span",12),t._uU(6,"Scan Serial"),t.qZA()()()()}}function ce(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openCouponCodeModal())}),t.TgZ(2,"a",20),t._UZ(3,"i",21),t.qZA(),t.TgZ(4,"div",15)(5,"span",12),t._uU(6,"Coupon"),t.qZA()()()()}}function le(o,s){if(1&o&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Oqu(e.totalOfflineOrders)}}function de(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li")(1,"div",8),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openSyncModal())}),t.TgZ(2,"a",22),t._UZ(3,"i",23),t.YNc(4,le,2,1,"span",16),t.qZA(),t.TgZ(5,"div",24)(6,"span",12),t._uU(7,"Sync Order"),t.qZA()()()()}if(2&o){const e=t.oxw();t.xp6(4),t.Q6J("ngIf",0!=e.totalOfflineOrders)}}let pe=(()=>{class o{constructor(e,n,r,a,l,m){(0,i.Z)(this,"_localDataService",void 0),(0,i.Z)(this,"_promotionEventService",void 0),(0,i.Z)(this,"matDialog",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"orderProcessorService",void 0),(0,i.Z)(this,"isOnline",void 0),(0,i.Z)(this,"returnEnabled",!0),(0,i.Z)(this,"totalOfflineOrders",0),(0,i.Z)(this,"totalEligiblePromotion",0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"posState",g.J),this._localDataService=e,this._promotionEventService=n,this.matDialog=r,this._posService=a,this._userRoleService=l,this.orderProcessorService=m,this.destroy$=new v.x}ngOnInit(){this.subscribeToObservable()}subscribeToObservable(){this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.returnEnabled=e.Return}),this._promotionEventService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(()=>{this.totalEligiblePromotion=this._promotionEventService.getTotalEligiblePromotion()}),this._promotionEventService.onClickToastPromo.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.openPromotionModal()}),this._localDataService.findAllOrders().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.totalOfflineOrders=e.length})}openOnlineStatusModal(){this.matDialog.open(zt)}openSyncModal(){this.matDialog.open(Wt.c)}openCouponCodeModal(){this.matDialog.open(Bt.P)}openReturnModal(){this.matDialog.open(jt.F)}openPromotionModal(){this.matDialog.open(pt.t,{id:"promotion-event"})}openSerialModal(){this.matDialog.open(Xt.y)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(W.T),t.Y36(X.D),t.Y36(h.uw),t.Y36(x.W),t.Y36(T.J),t.Y36(M.d))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-header"]],inputs:{isOnline:"isOnline"},decls:15,vars:7,consts:[[1,"d-flex","align-items-center"],[1,"me-6"],["matTooltip","Working Status",1,"btn","btn-gray","fw-normal","p-4",3,"click"],[1,"fa","fa-circle","me-2",3,"ngClass"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle","py-4","ps-3"],[1,"caret"],["aria-labelledby","moreMenu",1,"dropdown-menu",2,"left","87%","top","85%"],[4,"ngIf"],[1,"dropdown-item","cursor-pointer","d-flex","align-items-center",3,"click"],["matTooltip","Return","data-cy","Return",1,"header","align-middle","cursor-pointer"],["aria-hidden","true","matBadgeColor","warn","matBadgeSize","small","matBadge","!",1,"fa","fa-retur","retur-badge",3,"matBadgeHidden"],[1,"ms-2"],[1,"fs-5"],["matTooltip","Promotion",1,"header","align-middle","cursor-pointer","ms-1"],[1,"fas","fa-gift","text-black","fs-1"],[1,"ms-3"],["class","position-absolute badge badge rounded-pill bg-danger",4,"ngIf"],[1,"position-absolute","badge","badge","rounded-pill","bg-danger"],["matTooltip","Scan Serial",1,"header","align-middle","cursor-pointer"],[1,"fa-solid","fa-barcode-read","fs-1","text-black"],["matTooltip","Promotion Coupon",1,"header","align-middle","cursor-pointer"],["data-cy","Coupon","aria-hidden","true",1,"fa","fa-coupon"],["matTooltip","Synchronize",1,"header","align-middle","cursor-pointer","ms-1"],[1,"fas","fa-rotate","text-black","fs-1"],[1,"ms-4"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"a",2),t.NdJ("click",function(){return n.openOnlineStatusModal()}),t._UZ(3,"i",3),t.TgZ(4,"span"),t._uU(5),t.qZA()()(),t.TgZ(6,"div")(7,"button",4),t._UZ(8,"b",5),t.qZA(),t.TgZ(9,"ul",6),t.YNc(10,ie,8,3,"li",7),t.YNc(11,ae,8,1,"li",7),t.YNc(12,se,7,0,"li",7),t.YNc(13,ce,7,0,"li",7),t.YNc(14,de,8,1,"li",7),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngClass",n.isOnline?"text-success":"text-danger"),t.xp6(2),t.Oqu(n.isOnline?"Online":"Offline"),t.xp6(5),t.Q6J("ngIf",n.returnEnabled&&n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline))},dependencies:[p.mk,p.O5,ne,D.gM,p.Ov],styles:[".fa-coupon[_ngcontent-%COMP%]{background-position-y:center;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/coupon.svg);height:26px;width:26px;background-repeat:no-repeat}.fa-retur[_ngcontent-%COMP%]{background-position-y:center;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Icon/return.svg);height:26px;width:26px;background-repeat:no-repeat}.btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}i.retur-badge.mat-badge[_ngcontent-%COMP%] > span.mat-badge-content[_ngcontent-%COMP%]{font-size:10px}"]})),o})();var _t=c(98210),F=c(75033),ue=c(51178),ft=c(59660),Y=c(13421),ht=c(79666),ge=c(70755),Ct=c(39300),me=c(11156),S=c(57372),H=c(54102),bt=c(71965),vt=c(83902),_e=c(23370),fe=c(55593);function he(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"span",23),t._UZ(2,"i",24),t.qZA(),t.TgZ(3,"span",25),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.tabIndexActive=r.availablePoint>0?1:r.tabIndexActive)}),t._uU(4),t.ALo(5,"number"),t.qZA(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(4),t.hij(" ",t.lcZ(5,1,e.pointUsed)," Points redeemed ")}}function Ce(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"tab",27)(1,"div",4)(2,"div",5)(3,"label",6),t._uU(4,"Point Used"),t.qZA()(),t.TgZ(5,"div",7)(6,"input",28),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.pointUsed=r)})("ngModelChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onInputPoint(r))}),t.qZA(),t.TgZ(7,"span",29),t._uU(8,"of "),t.TgZ(9,"a",30),t._uU(10),t.ALo(11,"number"),t.qZA()()()()()}if(2&o){const e=t.oxw(2);t.Q6J("active",1==e.tabIndexActive&&e.availablePoint>0),t.xp6(6),t.Q6J("disabled",e.isEditOrder)("ngModel",e.pointUsed)("max",e.availablePoint?e.availablePoint:0),t.xp6(3),t.Q6J("href","/menu/Contacts/Loyalty/Current_Point/Point_History?ID="+(null==e.salesOrderData||null==e.salesOrderData.Order?null:e.salesOrderData.Order.CustomerID),t.LSH),t.xp6(1),t.hij(" ",t.lcZ(11,6,e.availablePoint)," Points ")}}function be(o,s){if(1&o&&(t.ynx(0),t.YNc(1,Ce,12,8,"tab",26),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.availablePoint&&e.availablePoint>0)}}function ve(o,s){if(1&o){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",4)(2,"div",18)(3,"strong"),t._uU(4,"Discount After Tax"),t.qZA()(),t.TgZ(5,"div",31)(6,"input",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.discountAfterTax=r)})("ngModelChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onDiscountAfterTaxChange())}),t.qZA()()(),t.BQk()}if(2&o){const e=t.oxw();t.xp6(6),t.Q6J("ngModel",e.discountAfterTax)}}let xt=(()=>{class o{constructor(e,n,r,a,l,m,f,C){(0,i.Z)(this,"_dialogRef",void 0),(0,i.Z)(this,"_orderService",void 0),(0,i.Z)(this,"_invoiceCalculatorService",void 0),(0,i.Z)(this,"_posHttpResponseService",void 0),(0,i.Z)(this,"_customerService",void 0),(0,i.Z)(this,"registerActiveService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"data",void 0),(0,i.Z)(this,"modalConfig",new lt.O),(0,i.Z)(this,"discount1",void 0),(0,i.Z)(this,"discount2",void 0),(0,i.Z)(this,"discountAmount",void 0),(0,i.Z)(this,"surcharge",void 0),(0,i.Z)(this,"discountAfterTax",void 0),(0,i.Z)(this,"currencySymbol",void 0),(0,i.Z)(this,"salesOrderData",void 0),(0,i.Z)(this,"discounts",[]),(0,i.Z)(this,"pointUsed",void 0),(0,i.Z)(this,"availablePoint",void 0),(0,i.Z)(this,"tabIndexActive",null),(0,i.Z)(this,"isEnabledMemberPoint",void 0),(0,i.Z)(this,"isDisabledLoyaltyPoint",void 0),(0,i.Z)(this,"isEditOrder",void 0),(0,i.Z)(this,"currentSelectedTax",void 0),this._dialogRef=e,this._orderService=n,this._invoiceCalculatorService=r,this._posHttpResponseService=a,this._customerService=l,this.registerActiveService=m,this._orderProcessorService=f,this.data=C,this.modalConfig.title="Order Discount",this.modalConfig.customWidth="480px",this.salesOrderData=this._orderService.Data,this.discount1=this.salesOrderData.Order.Discount,this.discount2=this.salesOrderData.Order.Discount2,this.discountAmount=this.salesOrderData.Order.DiscountAmount,this.surcharge=this.salesOrderData.Invoice.SurchargePcg,this.discountAfterTax=this._invoiceCalculatorService.discountAfterTax,this.currencySymbol=this._invoiceCalculatorService.currencySymbol,this.currentSelectedTax=this._invoiceCalculatorService.tax,this.pointUsed=this._orderService.Data.Order.PointUsed,this.tabIndexActive=C?.tabIndexActive,this.isEnabledMemberPoint=this.registerActiveService.Data.MemberPoint,this.isDisabledLoyaltyPoint=this._customerService.Data.LoyaltyDisabled,this.isEditOrder=this._orderProcessorService.Data.posState==g.J.IsEdit,this.initAvailablePoint()}initAvailablePoint(){let e=this._customerService?.Data?.Point,n=this._customerService?.Data?.PointUsed;this.availablePoint=(e||0)-(n||0)}onOk(){this.salesOrderData.Order.Discount=this.discount1,this.salesOrderData.Order.Discount2=this.discount2,this.salesOrderData.Invoice.SurchargePcg=this.surcharge,this.salesOrderData.Invoice.TempSurchargePcg=this.surcharge,this.salesOrderData.Order.DiscountAmount=this.discountAmount,this._invoiceCalculatorService.discountAfterTax=this.discountAfterTax,this._orderService.Data.Order.PointUsed=this.pointUsed,this._orderService.pushNewValue(this.salesOrderData),this.close()}close(){this._dialogRef.close()}onDiscountAfterTaxChange(){this.discountAmount=this.discountAfterTax;let n=this._invoiceCalculatorService.TotalBeforeTax-this.discountAmount,l=u.gT.FilterByID(this._posHttpResponseService.Data.Taxes,this._orderService.Data.Order.TaxTypeID);if(u.gT.IsNotEmpty(l)&&l.CalculationTypeID==me.E.Add){let m=1+l.Rate/100,f=n*m;this.discountAmount=(f-(f-this.discountAfterTax))/m}this._orderService.Data.Order.DiscountAmount=this.discountAmount}calculateDiscountCalculator(){var e=100;this.discounts.forEach(n=>{e=e*(100-n)/100}),this.discount1=100-e,this._orderService.Data.Order.Discount=this.discount1}onInputPoint(e){const a=this._orderService.Data.RedeemableAmount;let l=e,m=this._posHttpResponseService.Data.AppConfigJSON.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,f=e*m;f>a&&(l=Math.ceil(a/m),f=a),this.pointUsed=l,this.discountAmount=f}onTabChange(e){"loyalty"!==e&&(this.tabIndexActive=null)}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(h.so),t.Y36(S.q),t.Y36(H.J),t.Y36(x.W),t.Y36(bt.r),t.Y36(P.o),t.Y36(M.d),t.Y36(h.WI))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["POS-modal-discount"]],decls:54,vars:21,consts:[[3,"config","keydown.F2","onOk","onCancel","onClose"],[1,"container"],[3,"onTabChange"],["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",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],[1,"ms-1"],[1,"mx-2"],["type","text","data-cy","discount2","autoNum","","percentage","","decimalPlaces","2",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],["type","text","data-cy","discountamount","autoNum","",1,"form-control","d-inline-block",2,"width","100px",3,"disabled","ngModel","ngModelChange"],[4,"ngIf"],["type","text","data-cy","surcharge","autoNum","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","max","min","ngModelChange"],["tabTitle","Calculator"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-4"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],["type","text","data-cy","discountCal2","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],["type","text","data-cy","discountCal3","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModel","preventNegative","ngModelChange"],[1,"pointer"],[1,"fa-solid","fa-circle-info","ms-2"],[1,"pointer",3,"click"],["tabTitle","Loyalty",3,"active",4,"ngIf"],["tabTitle","Loyalty",3,"active"],["type","text","data-cy","surcharge","autoNum","",1,"form-control","d-inline-block",2,"width","80px",3,"disabled","ngModel","max","ngModelChange"],[1,"ms-3"],["target","_blank",3,"href"],["matTooltip","Calculate discount that needs to be given after tax",1,"col-8","ps-6"],["type","text","num-neg","false","autoNum","",1,"txtPrice","form-control",2,"width","100px",3,"ngModel","ngModelChange"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("keydown.F2",function(){return n.onOk()})("onOk",function(){return n.onOk()})("onCancel",function(){return n.close()})("onClose",function(){return n.close()}),t.TgZ(1,"content")(2,"div",1)(3,"custom-tabs",2),t.NdJ("onTabChange",function(a){return n.onTabChange(a)}),t.TgZ(4,"tab",3)(5,"div",4)(6,"div",5)(7,"label",6),t._uU(8,"Discount %"),t.qZA()(),t.TgZ(9,"div",7)(10,"input",8),t.NdJ("ngModelChange",function(a){return n.discount1=a}),t.qZA(),t.TgZ(11,"span",9),t._uU(12,"%"),t.qZA(),t.TgZ(13,"span",10),t._uU(14,"+"),t.qZA(),t.TgZ(15,"input",11),t.NdJ("ngModelChange",function(a){return n.discount2=a}),t.qZA(),t.TgZ(16,"span",9),t._uU(17,"%"),t.qZA()()(),t.TgZ(18,"div",12)(19,"div",5)(20,"label",6),t._uU(21),t.qZA()(),t.TgZ(22,"div",7)(23,"input",13),t.NdJ("ngModelChange",function(a){return n.discountAmount=a}),t.qZA(),t.YNc(24,he,6,3,"ng-container",14),t.qZA()(),t.TgZ(25,"div",12)(26,"div",5)(27,"label",6),t._uU(28,"Surcharge"),t.qZA()(),t.TgZ(29,"div",7)(30,"input",15),t.NdJ("ngModelChange",function(a){return n.surcharge=a}),t.qZA(),t.TgZ(31,"span",9),t._uU(32,"%"),t.qZA()()()(),t.YNc(33,be,2,1,"ng-container",14),t.TgZ(34,"tab",16),t.YNc(35,ve,7,1,"ng-container",14),t.TgZ(36,"div",17)(37,"div",18)(38,"label",6),t._uU(39,"Discount Calculator"),t.qZA()(),t.TgZ(40,"div",19)(41,"input",20),t.NdJ("ngModelChange",function(a){return n.discounts[0]=a})("ngModelChange",function(){return n.calculateDiscountCalculator()}),t.qZA(),t.TgZ(42,"span"),t._uU(43," %"),t.qZA(),t.TgZ(44,"span",10),t._uU(45,"+"),t.qZA(),t.TgZ(46,"input",21),t.NdJ("ngModelChange",function(a){return n.discounts[1]=a})("ngModelChange",function(){return n.calculateDiscountCalculator()}),t.qZA(),t.TgZ(47,"span"),t._uU(48," %"),t.qZA(),t.TgZ(49,"span",10),t._uU(50,"+"),t.qZA(),t.TgZ(51,"input",22),t.NdJ("ngModelChange",function(a){return n.discounts[2]=a})("ngModelChange",function(){return n.calculateDiscountCalculator()}),t.qZA(),t.TgZ(52,"span"),t._uU(53," %"),t.qZA()()()()()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(4),t.Q6J("active",1!==n.tabIndexActive),t.xp6(6),t.Q6J("ngModel",n.discount1)("preventNegative",!0),t.xp6(5),t.Q6J("ngModel",n.discount2)("preventNegative",!0),t.xp6(6),t.hij("Discount ",n.currencySymbol,""),t.xp6(2),t.Q6J("disabled",n.pointUsed&&n.pointUsed>0)("ngModel",n.discountAmount),t.xp6(1),t.Q6J("ngIf",n.pointUsed&&n.pointUsed>0),t.xp6(6),t.Q6J("ngModel",n.surcharge)("max",100)("min",-100),t.xp6(3),t.Q6J("ngIf",n.isEnabledMemberPoint&&!n.isDisabledLoyaltyPoint),t.xp6(2),t.Q6J("ngIf",null==n.currentSelectedTax?null:n.currentSelectedTax.Rate),t.xp6(6),t.Q6J("ngModel",n.discounts[0])("preventNegative",!0),t.xp6(5),t.Q6J("ngModel",n.discounts[1])("preventNegative",!0),t.xp6(5),t.Q6J("ngModel",n.discounts[2])("preventNegative",!0))},dependencies:[p.O5,_.Fj,_.JJ,_.On,I.M,vt.b,D.gM,_e.x,fe.i,p.JJ]})),o})();var xe=c(65550),K=c(76874),et=c(98085),A=c(58393),nt=c(76359),Pe=c(19835);function ye(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onShowPointModal())}),t._UZ(1,"i",12),t.qZA()}}function Oe(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onShowPointModal())}),t._UZ(1,"h6",14),t.TgZ(2,"span",15),t._uU(3),t.ALo(4,"number"),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("innerHtml",e.getLabelLoyalty(),t.oJD),t.xp6(2),t.Oqu(null!=e.customerData&&e.customerData.Point?t.lcZ(4,2,null==e.customerData?null:e.customerData.Point):0)}}function Me(o,s){if(1&o&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e.customerData?null:e.customerData.Debt)," ")}}function De(o,s){1&o&&(t.TgZ(0,"span"),t._uU(1,"-"),t.qZA())}function Se(o,s){if(1&o&&(t.ynx(0),t.TgZ(1,"span"),t._uU(2),t.ALo(3,"number"),t.qZA(),t.BQk()),2&o){const e=t.oxw();t.xp6(2),t.Oqu(t.lcZ(3,1,null==e.customerData?null:e.customerData.DebtLimit))}}function Ze(o,s){1&o&&(t.TgZ(0,"span"),t._uU(1,"\u221e"),t.qZA())}let Te=(()=>{class o{constructor(){(0,i.Z)(this,"customerData",void 0),(0,i.Z)(this,"enabledPoint",void 0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"showPointModal",new t.vpe)}getLabelLoyalty(){if(null!=this.customerData)return null!=this.customerData.Label?""==this.customerData.Label.trim()?"Loyalty":this.customerData.Label:"Loyalty"}onShowPointModal(){this.enabledPoint&&this.showPointModal.emit()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["customer-info"]],inputs:{customerData:"customerData",enabledPoint:"enabledPoint",role:"role"},outputs:{showPointModal:"showPointModal"},decls:18,vars:6,consts:[[1,"customer-panel","position-absolute"],[1,"row","px-5","customer-info-box","arrow-box-bottom","g-0"],["class","col-auto",3,"click",4,"ngIf"],["class","col-auto ms-3",3,"click",4,"ngIf"],[1,"col-auto","ms-3"],["aria-hidden","true",1,"fa-solid","fa-dollar-sign","fa-fw"],[1,"col-auto"],[4,"ngIf","ngIfElse"],["NotHasRole",""],[1,"ms-1","me-1"],["UNLIMITED",""],[1,"col-auto",3,"click"],["data-cy","loyalty","aria-hidden","true",1,"fa","fa-star","fa-fw"],[1,"col-auto","ms-3",3,"click"],[3,"innerHtml"],[2,"font-size","12px"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1),t.YNc(2,ye,2,0,"div",2),t.YNc(3,Oe,5,4,"div",3),t.TgZ(4,"div",4),t._UZ(5,"i",5),t.qZA(),t.TgZ(6,"div",6)(7,"h6"),t._uU(8,"Debt"),t.qZA(),t.TgZ(9,"span"),t.YNc(10,Me,3,3,"ng-container",7),t.YNc(11,De,2,0,"ng-template",null,8,t.W1O),t.TgZ(13,"span",9),t._uU(14,"/"),t.qZA(),t.YNc(15,Se,4,3,"ng-container",7),t.YNc(16,Ze,2,0,"ng-template",null,10,t.W1O),t.qZA()()()()),2&e){const r=t.MAs(12),a=t.MAs(17);t.xp6(2),t.Q6J("ngIf",n.enabledPoint),t.xp6(1),t.Q6J("ngIf",n.enabledPoint),t.xp6(7),t.Q6J("ngIf",null==n.role?null:n.role.DebtView)("ngIfElse",r),t.xp6(5),t.Q6J("ngIf",(null==n.customerData?null:n.customerData.DebtLimit)>0)("ngIfElse",a)}},dependencies:[p.O5,p.JJ],styles:['.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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.customer-panel[_ngcontent-%COMP%]{top:-60px;z-index:1030;margin:auto;left:-85px}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%]{text-align:left;border:1px solid #bbbbbb;padding:5px;margin-bottom:2px;position:relative;display:flex;left:100px}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:0;font-size:1.25rem;padding-top:4px;color:#337ab7}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%] div.col-3[_ngcontent-%COMP%]{text-align:left;right:8px}.customer-panel[_ngcontent-%COMP%] > div.row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.65625rem;margin-top:4px}.customer-info-box[_ngcontent-%COMP%]{background-color:#ffffe1!important}.customer-info-box[_ngcontent-%COMP%]:after{border-width:6px!important;margin-left:-6px!important;border-top-color:#ffffe1!important}.customer-info-box[_ngcontent-%COMP%]:before{border-width:7px!important;margin-left:-7px!important}.arrow-box-bottom[_ngcontent-%COMP%]{position:relative;background:white;border:2px solid #bbbbbb;border-radius:.25rem}.arrow-box-bottom[_ngcontent-%COMP%]:after, .arrow-box-bottom[_ngcontent-%COMP%]:before{top:100%;left:50%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-bottom[_ngcontent-%COMP%]:after{border-color:#0000;border-top-color:#fff;border-width:5px;margin-left:-5px}.arrow-box-bottom[_ngcontent-%COMP%]:before{border-color:#c2e1f500;border-top-color:#bbb;border-width:8px;margin-left:-8px}']})),o})();var Z=c(93669);const Ie=["ngSelectInfinite"];function ke(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"customer-info",19),t.NdJ("showPointModal",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.cashierShowPointModal())}),t.qZA()}if(2&o){const e=t.oxw(2);t.Q6J("customerData",e.customerData)("role",e.role)("enabledPoint",e.isEnabledLoyaltyPoint)}}function Ae(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",20),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.openCustomerModal())}),t._UZ(1,"i",21),t.qZA()}}function we(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",14),t.YNc(1,ke,1,3,"customer-info",15),t._UZ(2,"i",16),t.TgZ(3,"autocompleteV2",17),t.NdJ("optionSelected",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onSelectCustomer(r))})("onInputChange",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onInputCustomer(r))})("onSelect",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onCustomerSelected(r))})("onInputEnter",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.onScanCodeCustomer(r))}),t.qZA(),t.YNc(4,Ae,2,0,"a",18),t.qZA()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.customerData&&((null==e.customerData?null:e.customerData.Point)>=0||(null==e.customerData?null:e.customerData.Debt)>0)&&e.checkCustomerEmpty(e.posData.Order.CustomerID)),t.xp6(2),t.Q6J("inputTextValue",e.posData.ContactName)("inputLock",e.role.CustomerInputLock)("prefixIcon",e.role.CustomerInputLock?"fa-solid fa-text-slash":""),t.xp6(1),t.Q6J("ngIf",e.role.ContactsCreate&&e.customerQuickAddEnabled)}}const Ne=function(o){return{"date-warnings":o}};let Je=(()=>{class o{handleF1(){this.setFocusCustomerInput()}handleF2(){this.setFocusSalesPerson()}get isEditState(){return this.posState===g.J.IsEdit}constructor(e,n,r,a,l,m,f,C,y,O,q,R){(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_CustomerHttpService",void 0),(0,i.Z)(this,"_toastrService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_CoreHttpService",void 0),(0,i.Z)(this,"_invoiceCalculatorService",void 0),(0,i.Z)(this,"_shoppingCartService",void 0),(0,i.Z)(this,"selectedRegister",new _t.t),(0,i.Z)(this,"isOnline",void 0),(0,i.Z)(this,"openModal",void 0),(0,i.Z)(this,"customerQuickAddEnabled",!0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"newDate",new Date),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"selectedCustomerId",void 0),(0,i.Z)(this,"posState",g.J.IsNew),(0,i.Z)(this,"isNotToday",void 0),(0,i.Z)(this,"sales",void 0),(0,i.Z)(this,"SalesPerson",!0),(0,i.Z)(this,"customerData",void 0),(0,i.Z)(this,"appConfig",new Y.A),(0,i.Z)(this,"salesPersonName",""),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"previousCustomerID",void 0),(0,i.Z)(this,"isEnabledLoyaltyPoint",void 0),(0,i.Z)(this,"disabledSalesOption",!1),(0,i.Z)(this,"ngSelectInfinite",void 0),this._onlineStatusService=e,this._outletService=n,this._orderDataService=r,this._posService=a,this._matDialog=l,this._orderProcessorService=m,this._CustomerHttpService=f,this._toastrService=C,this._userRoleService=y,this._CoreHttpService=O,this._invoiceCalculatorService=q,this._shoppingCartService=R,this.destroy$=new v.x}ngOnInit(){this.appConfig=this._posService.Data.AppConfigJSON,this.customerQuickAddEnabled=this.appConfig.ModuleSell.Customer.QuickAddEnabled,this.subscribeToValueChanges()}subscribeToValueChanges(){this.subscribeToCartItemsChange(),this._onlineStatusService.getOnlineStatus$().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.isOnline=e}),this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e,this.checkDisabledSalesOption()}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.customerData=this._CustomerHttpService.Data,this.posState=e.posState,this.initEnableLoyaltyPoint(),e.posState===g.J.isPark&&this.clearContactName()}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.selectedRegister=e,this.sales=e.ListSales,this.initEnableLoyaltyPoint()}),this._orderProcessorService.clearOrder$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{e&&this.clearContactName()})}setFocusCustomerInput(){let e=document.getElementById("ContactID");e&&e.focus()}setFocusSalesPerson(){this.ngSelectInfinite&&this.ngSelectInfinite.ngSelectElement.focus()}checkDisabledSalesOption(){this.disabledSalesOption=!1,this.posData.CartItems.filter(n=>u.gT.IsNotEmpty(n.SalesID)).length>0&&(this.disabledSalesOption=!0)}initEnableLoyaltyPoint(){this.isEnabledLoyaltyPoint=!1,!this.customerData.LoyaltyDisabled&&this.selectedRegister.MemberPoint&&(this.isEnabledLoyaltyPoint=!0)}clearContactName(){this.posData.ContactName=null}subscribeToCartItemsChange(){let e=0;this._orderDataService.Data$.pipe((0,d.R)(this.destroy$),(0,Ct.h)(n=>e!=n.TotalQuantity)).subscribe(n=>{e=n.TotalQuantity,this._orderProcessorService.reedemPointToDiscount()})}openRegisterModal(){this._matDialog.open(ue.d,{id:"registerModal"}).afterClosed().subscribe(n=>{n&&this.openOpeningCashModal()})}openOpeningCashModal(){this.appConfig.ModuleShift.Closure.Enabled&&this.appConfig.ModuleShift.Closure.OpeningCashRequired&&this._matDialog.open(ge.X).afterClosed().subscribe(n=>{n&&null!=n.amount&&(this._CoreHttpService.recordOpeningCash({RegisterID:this.posData.Order.RegisterID,OpAmount:n.amount}),document.getElementById("product").focus())})}openCustomerModal(){this._matDialog.open(ht.A,{autoFocus:!1}).afterClosed().subscribe(e=>{e&&(this._orderProcessorService.pushNewValue(this._orderProcessorService.Data),this.updateDiscountRate(e.DiscountRate))})}cashierShowPointModal(){this._orderProcessorService.Data.posState!=g.J.IsEdit?this._matDialog.open(xt,{data:{tabIndexActive:1}}):this._toastrService.warning("Apply Loyalty Point is not allowed in edit mode","Warning!")}updateSales(){this.salesPersonName=this.sales.filter(e=>e.ID==this.posData.Order.SalesID)[0]?.Name,this._orderDataService.pushNewValue(this.posData)}checkIsNotToday(e){if(e){const n=new Date;n.setHours(0,0,0,0),this.isNotToday=n.getTime()!=e.getTime()}}inputNumberModelChanged(e){this.posData.Order.Number=e}onInputCustomer(e){this._orderProcessorService.Data.InputTextValue=e,null!==e&&0==e.length&&(this.resetCustomerPricebook(),this.posData.Order.PointUsed=0,this.posData.Order.DiscountAmount=0,this.previousCustomerID=JSON.parse(JSON.stringify(this.posData.Order.CustomerID)),this.posData.Order.CustomerID=null,this._CustomerHttpService.Data=new ft.B,this.customerData=new ft.B,this.updateDiscountRate(),this.setFocusCustomerInput())}resetCustomerPricebook(){if(this.customerData){let e=this.customerData.PricebookID;u.gT.IsNotEmpty(e)&&(this.posData.CartItems=this.posData.CartItems.map(r=>(r.PriceBookID==e&&(r.Discount=r.Variant.PriceDiscount,r.Note=r.Variant.PriceNote,r.PriceNote=r.Variant.PriceNote,r.PriceBookID=u.gT.GuidEmpty,r.Price=r.Variant.UnitPrice,r.UnitPrice=r.Variant.UnitPrice),r)))}}onScanCodeCustomer(e){this.clearContactName(),0!==e.length&&this._CustomerHttpService.findCustomerByCode(e).pipe((0,d.R)(this.destroy$)).subscribe(n=>{this.posData.ContactName=n.Display,this.onCustomerSelected(n.ID)})}onCustomerSelected(e){this.previousCustomerID=JSON.parse(JSON.stringify(this.posData.Order.CustomerID)),this.resetCartOnChangeCustomer(e),u.gT.IsNotEmpty(e)&&this._orderDataService.updateCustomerID(e).then(n=>{this.applyCustomerPricebook(n),this.updateTaxCustomer(n.TaxTypeId),u.gT.IsNotEmpty(n.SalesID)&&(this.posData.Order.SalesID=n.SalesID),n.EntityID==u.gT.GuidEmpty?this.customerData=n:n.EntityID!=this.posData.Order.EntityID?(this.posData.Order.CustomerID=null,this.clearContactName(),alert("your customer has a exclusive outlet")):this.customerData=n,null==this.customerData.DiscountRate&&(this.customerData.DiscountRate=0),this.initEnableLoyaltyPoint();const r=this.calculateCustomerDiscount(e);this.updateDiscountRate(r);let a=this.checkResetRedeemPoint();this._orderProcessorService.reedemPointToDiscount(a)})}calculateCustomerDiscount(e){let n=this.customerData.DiscountRate;return u.gT.IsEmpty(this.previousCustomerID)?(n=(n||0)+this.posData.Order.Discount,n>100&&(n=100)):e!==this.previousCustomerID&&(n=n||0),n}checkResetRedeemPoint(){let e=!1;return u.gT.IsNotEmpty(this.previousCustomerID)&&(e=!0),e}applyCustomerPricebook(e){if(u.gT.IsNotEmpty(e.PricebookID)){let n=this.posData.CartItems.map(r=>(r.Variant.PriceBook&&0!==r.Variant.PriceBook.length&&r.Variant.PriceBook.forEach(a=>{a.ID===e.PricebookID&&(r=this._shoppingCartService.applyPricebookToItem(r,a))}),r));this.posData.CartItems=n}}updateDiscountRate(e=0){this.posData.Order.Discount=e,this._orderDataService.pushNewValue()}updateTaxCustomer(e){let r=this._posService.Data.Taxes.find(a=>a.ID==e);r&&(this._orderDataService.Data.Order.TaxTypeID=r.ID,this._invoiceCalculatorService.tax=r,this._orderDataService.pushNewValue())}checkCustomerEmpty(e){let n=u.gT.IsNotEmpty(e);return e&&e.length<u.gT.GuidEmpty.length&&(n=!1),n}resetCartOnChangeCustomer(e){this.selectedCustomerId!=e&&this.appConfig.ModuleSell.Customer.ClearCartOnChange&&(this.posData.CartItems=[],this._orderDataService.pushNewValue(this.posData)),this.selectedCustomerId=e}displayRegisterName(e){let n="Choose an Outlet";const r=this.findOutletRegisterById(e.RegisterID);return null!=r&&null!=r.Name&&(n=r.Name),n}onSelectCustomer(e){const n=JSON.parse(e);this.posData.ContactName=n.Value}findOutletRegisterById(e){return this._posService.Data.Registers.find(a=>a.ID===e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(J.q),t.Y36(P.o),t.Y36(S.q),t.Y36(x.W),t.Y36(h.uw),t.Y36(M.d),t.Y36(bt.r),t.Y36(U._W),t.Y36(T.J),t.Y36(xe.I),t.Y36(H.J),t.Y36(K.F))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-toolbar"]],viewQuery:function(e,n){if(1&e&&t.Gf(Ie,7),2&e){let r;t.iGM(r=t.CRH())&&(n.ngSelectInfinite=r.first)}},hostBindings:function(e,n){1&e&&t.NdJ("keydown.control.F1",function(a){return n.handleF1(a)},!1,t.Jf7)("keydown.control.F2",function(a){return n.handleF2(a)},!1,t.Jf7)},decls:15,vars:18,consts:[[1,"row","header","g-0","py-4"],["data-cy","ChooseRegister",1,"col-auto"],["matTooltipPosition","above","matTooltip","Outlet",1,"fa-solid","fa-house"],["placeholder","Choose an outlet","readonly","",1,"outlet","cursor","mobile-view",3,"disabled","value","click"],[1,"col-auto","date","mobile-view"],["appearance","fill","data_cy","soDate","name","orderDate",3,"ngClass","disabled","date","dateChange"],[1,"col-auto","number","mobile-view"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Sales order number",1,"fa","fa-hashtag"],["type","text","data-cy","soNumber","required","","placeholder","Number",1,"number",2,"margin-left","3px",3,"ngModel","disabled","ngModelChange"],["class","col-auto customer mobile-view position-relative",4,"ngIf"],[1,"col-auto","d-flex","flex-row","sales","mobile-view"],["aria-hidden","true","matTooltipPosition","above","matTooltip","sales",1,"fa","fa-id-badge","align-middle"],["bindValue","ID","bindLabel","Name","width","185px","position","top","placeholder","Sales Person",1,"sales-person",3,"items","selected","customTooltip","optionTitle","disabled","selectedChange"],["ngSelectInfinite",""],[1,"col-auto","customer","mobile-view","position-relative"],[3,"customerData","role","enabledPoint","showPointModal",4,"ngIf"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Customer",1,"fa","fa-user"],["data_cy","Contact","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Customer","inputID","ContactID","notFoundMessageFor","customer","prefixIconTitle","Customer Input by typing is locked",3,"inputTextValue","inputLock","prefixIcon","optionSelected","onInputChange","onSelect","onInputEnter"],["id","btnCustomer","class","ms-1 pointer","matTooltipPosition","above","matTooltip","New Customer Form",3,"click",4,"ngIf"],[3,"customerData","role","enabledPoint","showPointModal"],["id","btnCustomer","matTooltipPosition","above","matTooltip","New Customer Form",1,"ms-1","pointer",3,"click"],["data-cy","btnCust","aria-hidden","true",1,"fa-solid","fa-circle-plus"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"i",2),t.TgZ(3,"input",3),t.NdJ("click",function(){return n.openRegisterModal()}),t.ALo(4,"limitTo"),t.qZA()(),t.TgZ(5,"div",4)(6,"datepicker",5),t.NdJ("dateChange",function(a){return(null==n.posData?null:n.posData.Order).Date=a})("dateChange",function(a){return n.checkIsNotToday(a)}),t.qZA()(),t.TgZ(7,"div",6),t._UZ(8,"i",7),t.TgZ(9,"input",8),t.NdJ("ngModelChange",function(a){return n.inputNumberModelChanged(a)}),t.qZA()(),t.YNc(10,we,5,5,"div",9),t.TgZ(11,"div",10),t._UZ(12,"i",11),t.TgZ(13,"ng-select-infinite",12,13),t.NdJ("selectedChange",function(a){return(null==n.posData?null:n.posData.Order).SalesID=a})("selectedChange",function(){return n.updateSales()}),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("disabled",n.isEditState)("value",t.xi3(4,13,n.displayRegisterName(n.selectedRegister),20)),t.xp6(3),t.Q6J("ngClass",t.VKq(16,Ne,n.isNotToday))("disabled",!n.role.DateEditor)("date",null==n.posData?null:n.posData.Order.Date),t.xp6(3),t.Q6J("ngModel",null==n.posData?null:n.posData.Order.Number)("disabled",!n.role.NumberEditor),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(3),t.Q6J("items",n.sales)("selected",null==n.posData?null:n.posData.Order.SalesID)("customTooltip",n.salesPersonName)("optionTitle",!0)("disabled",n.disabledSalesOption||!n.role.SalesPerson))},dependencies:[p.mk,p.O5,et.QB,_.Fj,_.JJ,_.Q7,_.On,A.J,nt.R,D.gM,Pe.i,Te,Z.OI],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:3px!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex{background-color:#e9ecef!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-form-field-flex input{opacity:1!important;color:#00000061!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field{padding-right:0!important}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] mat-form-field .mat-mdc-text-field-wrapper{padding-bottom:0;background-color:#fff;padding-left:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-flex{width:147px;height:35px;border:1px solid rgb(207,207,207);margin-left:40px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix{border:none!important;top:5px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix{padding-top:4px;padding-bottom:4px;padding-left:8px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{position:relative;left:-140px;top:1px}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-button-persistent-ripple{color:#000}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix button.mat-mdc-icon-button.mat-mdc-button-base{padding:0}.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.date[_ngcontent-%COMP%] datepicker.date-warnings[_ngcontent-%COMP%] .mat-mdc-form-field-flex{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px,#f9e79f 30px)!important}.small[_ngcontent-%COMP%]{margin-right:5px!important}.small[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:143px}.small[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:140px}.small[_ngcontent-%COMP%] .select2-container[_ngcontent-%COMP%]{font-size:12px}.col-auto[_ngcontent-%COMP%]{font-size:.875rem;height:-moz-fit-content;height:fit-content}.col-auto[_ngcontent-%COMP%]:last-child{margin-right:0}.col-auto[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.25rem;color:#3b3b3b;margin-right:5px;line-height:unset!important;position:relative;top:2px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .col-auto[_ngcontent-%COMP%] span.outlet[_ngcontent-%COMP%]{padding:4px 8px 3px 5px;border:1px solid #dddddd;font-size:.875rem}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:36px}.col-auto[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{background-color:#e9ecef!important;opacity:1!important;color:#00000061!important}.col-auto[_ngcontent-%COMP%] .outlet[_ngcontent-%COMP%]{width:165px;color:#337ab7;background:#ffffff}.col-auto[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{width:135px}.col-auto.customer[_ngcontent-%COMP%] autocomplete[_ngcontent-%COMP%] input{font-size:14px}.col-auto.customer[_ngcontent-%COMP%] autocompleteV2[_ngcontent-%COMP%] input{font-size:14px}.col-auto.sales[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] input{font-size:14px}.col-auto[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%]{width:135px}.header[_ngcontent-%COMP%]{border-bottom:1px solid #dde2eb}.number[_ngcontent-%COMP%], .customer[_ngcontent-%COMP%]{margin-left:9px}.sales[_ngcontent-%COMP%]{margin-left:5px}@media (max-width: 575.98px){.mobile-view[_ngcontent-%COMP%]{margin-top:5px}.mobile-view[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:75%!important}} ng-select-infinite.sales-person ng-select .ng-dropdown-panel.ng-select-bottom{width:20rem!important}"]})),o})();var Ue=c(5607),L=c(53018);function Qe(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",9)(1,"a",10),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openUploadModal())}),t._UZ(2,"i",11),t.qZA()()}}function qe(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",9)(1,"a",12),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openAddItemModal())}),t._UZ(2,"i",13),t.TgZ(3,"small",14),t._uU(4,"(F4)"),t.qZA()()()}}let Re=(()=>{class o{handleF4(){this._matDialog.openDialogs&&this._matDialog.openDialogs.length>0||this.openAddItemModal()}focusProductInput(){this.setFocusToProductInput()}constructor(e,n,r,a,l){(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_cartService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_outletRegisterService",void 0),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"isEdit",!1),(0,i.Z)(this,"Items",void 0),(0,i.Z)(this,"isOnline",!0),(0,i.Z)(this,"AppConfigJSON",new Y.A),(0,i.Z)(this,"renderThumbnail",!1),this._posService=e,this._orderDataService=n,this._cartService=r,this._matDialog=a,this._outletRegisterService=l,this.destroy$=new v.x,this.AppConfigJSON=this._posService.Data.AppConfigJSON,this.renderThumbnail=this.AppConfigJSON.ModuleSell.ProductDialog.ShowThumbnail,this.subscribeToObservable()}ngAfterViewInit(){this.setFocusToProductInput()}subscribeToObservable(){this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e,this.Items=e.CartItems,this.setFocusToProductInput()}),this._outletRegisterService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.setFocusToProductInput()})}setFocusToProductInput(){let e=document.getElementById("product");e&&e.focus()}openUploadModal(){this._matDialog.open(Ue.h)}openAddItemModal(){this._matDialog.open(L.k)}addItem(e){this._cartService.addCartItemById(e).then(()=>{this.openModalItemOnNew(e)})}onBarcodeScan(e){u.gT.IsNotEmpty(e)&&this._cartService.addCartItemByCode(e).then(n=>{this.openModalItemOnNew(n.ID)})}openModalItemOnNew(e){if(this.AppConfigJSON.ModuleSell.ProductDialog.OpenOnNewItemAdded){let n=this.Items.find(a=>a.VariantID==e),r=this.Items.lastIndexOf(n);this._matDialog.open(L.k,{data:{index:r}})}}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(x.W),t.Y36(S.q),t.Y36(K.F),t.Y36(h.uw),t.Y36(P.o))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart-header"]],hostBindings:function(e,n){1&e&&t.NdJ("keydown.F4",function(a){return n.handleF4(a)},!1,t.Jf7)("keydown.control.F3",function(a){return n.focusProductInput(a)},!1,t.Jf7)},decls:14,vars:9,consts:[[1,"row","cart-header","g-0","justify-content-between","align-items-center","p-6"],["matTooltipPosition","above",1,"col-auto",3,"matTooltip"],[1,"fa","fa-shopping-cart","fa-lg","text-success","me-3"],[1,"col-auto"],[1,"input-group","barcode","barcode-input"],[1,"input-group-text","input-group-text"],["aria-hidden","true",1,"fa","fa-barcode"],["data-cy","ProductCart","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search product by name / code","localStorage","products","inputID","product","notFoundMessageFor","product",1,"input-left",3,"clearOnSelect","renderThumbnail","onSelect","onInputEnter"],["class","col-auto add-item",4,"ngIf"],[1,"col-auto","add-item"],["matTooltipPosition","above","matTooltip","Upload Item","data-bs-toggle","modal",1,"pointer","d-block","position-relative","cart-add",3,"click"],["aria-hidden","true",1,"fa","fa-upload","fa-2x","text-success"],["matTooltipPosition","above","matTooltip","Add Item (F4)",1,"pointer","d-block","position-relative","cart-add",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-2x","text-success"],[1,"position-absolute","fst-italic","right-bottom","text-dark"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h5"),t._UZ(3,"i",2),t._uU(4),t.ALo(5,"number"),t.qZA()(),t.TgZ(6,"div",3)(7,"div",4)(8,"div",5)(9,"span"),t._UZ(10,"i",6),t.qZA()(),t.TgZ(11,"autocompleteV2",7),t.NdJ("onSelect",function(a){return n.addItem(a)})("onInputEnter",function(a){return n.onBarcodeScan(a)}),t.qZA()()(),t.YNc(12,Qe,3,0,"div",8),t.YNc(13,qe,5,0,"div",8),t.qZA()),2&e&&(t.xp6(1),t.MGl("matTooltip","You have ",n.posData.cartQuantity," items in current sale"),t.xp6(3),t.AsE(" ",n.isEdit?"Update "+(null==n.posData.Order.ParkLabel?"":n.posData.Order.ParkLabel):"Current Sale "," (",t.lcZ(5,7,n.posData.cartQuantity),") "),t.xp6(7),t.Q6J("clearOnSelect",!0)("renderThumbnail",n.renderThumbnail),t.xp6(1),t.Q6J("ngIf",n.isOnline),t.xp6(1),t.Q6J("ngIf",n.isOnline))},dependencies:[p.O5,A.J,D.gM,p.JJ],styles:["div.row.cart-header{border:solid 1px #cfcfcf;border-bottom:none;border-radius:3px 3px 0 0;background:#f2f7fa;color:#222}div.row.cart-header .right-bottom{font-size:9px;right:-6px;bottom:-10px}.barcode-input{width:305px}.barcode-input>input{height:28px}.barcode-input autocompleteV2{width:267px}autocompleteV2.input-left>mat-form-field>input.form-control{padding-left:0!important;border-left:0!important}\n"],encapsulation:2})),o})();var B=c(41206),w=c(28255),ot=c(96308);const Ee=["cardContainer"];function Fe(o,s){1&o&&t._UZ(0,"th")}function Ye(o,s){1&o&&(t.TgZ(0,"th",20),t._uU(1," Brand "),t.qZA())}function He(o,s){1&o&&(t.TgZ(0,"th",20),t._uU(1," Inv. "),t.qZA())}function Ke(o,s){1&o&&t._UZ(0,"th",21)}function Le(o,s){if(1&o&&(t.TgZ(0,"td")(1,"small"),t._uU(2),t.qZA()()),2&o){const e=t.oxw().index;t.xp6(2),t.hij("",e+1,".")}}function Be(o,s){1&o&&t._UZ(0,"i",42)}function $e(o,s){if(1&o&&(t.TgZ(0,"i",43),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Variant.CategoryName)}}function Ge(o,s){1&o&&(t.ynx(0),t.TgZ(1,"i",46),t._uU(2,"V"),t.qZA(),t.BQk())}function Ve(o,s){1&o&&(t.TgZ(0,"i",47),t._uU(1,"N"),t.qZA())}function ze(o,s){if(1&o&&(t.TgZ(0,"p",44),t.YNc(1,Ge,3,0,"ng-container",30),t.YNc(2,Ve,2,0,"ng-template",null,45,t.W1O),t.qZA()),2&o){const e=t.MAs(3),n=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",n.Taxable)("ngIfElse",e)}}function je(o,s){if(1&o&&(t.ynx(0),t._UZ(1,"p",48),t.BQk()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("innerHtml",e.SerialNote,t.oJD)}}function We(o,s){if(1&o&&t._UZ(0,"p",48),2&o){const e=t.oxw(2).$implicit;t.Q6J("innerHtml",e.Note,t.oJD)}}function Xe(o,s){if(1&o&&t.YNc(0,We,1,1,"p",49),2&o){const e=t.oxw().$implicit;t.Q6J("ngIf",e.Note)}}function tn(o,s){if(1&o&&(t.TgZ(0,"p")(1,"i",50),t._uU(2),t.qZA()()),2&o){const e=t.oxw().$implicit,n=t.oxw();t.xp6(2),t.hij("Fulfillment from: ",n.getOutletName(e.EntityID),"")}}function en(o,s){if(1&o&&(t.TgZ(0,"p",51),t._uU(1," Sold by "),t.TgZ(2,"i"),t._uU(3),t.qZA()()),2&o){const e=t.oxw().$implicit,n=t.oxw();t.xp6(3),t.hij(" ",n.getSalesName(e.SalesID)," ")}}function nn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"td",38),t.NdJ("click",function(){t.CHM(e);const r=t.oxw().index,a=t.oxw();return t.KtG(a.openItemModal(r))}),t._uU(1),t.qZA()}if(2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.Variant.BrandName," ")}}function on(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"td",52),t.NdJ("click",function(){t.CHM(e);const r=t.oxw().index,a=t.oxw();return t.KtG(a.openItemModal(r))}),t.qZA()}if(2&o){const e=t.oxw().$implicit;t.Q6J("innerHtml",e.Variant.UnitsInStock,t.oJD)}}function rn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij("x",e.UnitQuantity,"")}}function an(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij("@",e.VariantUnitQuantity,"")}}function sn(o,s){if(1&o&&(t.TgZ(0,"td")(1,"small"),t._uU(2),t.qZA()()),2&o){const e=t.oxw().$implicit;t.xp6(2),t.Oqu("null"!=e.Variant.UOM?e.Variant.UOMName:"")}}function cn(o,s){1&o&&(t.ynx(0),t._uU(1," - "),t.BQk())}function ln(o,s){if(1&o&&(t.TgZ(0,"div",55),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(3).$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.UnitPriceOriginal,"1.0-4")," ")}}function dn(o,s){if(1&o&&(t.ynx(0),t.YNc(1,ln,3,4,"div",54),t.TgZ(2,"div"),t._uU(3),t.ALo(4,"number"),t.qZA(),t.BQk()),2&o){const e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",e.UnitPriceOriginal>e.Price),t.xp6(2),t.hij(" ",t.xi3(4,2,e.Price,"1.0-4")," ")}}function pn(o,s){if(1&o&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Price,"1.0-4")," ")}}function un(o,s){if(1&o&&(t.YNc(0,dn,5,5,"ng-container",30),t.YNc(1,pn,3,4,"ng-template",null,53,t.W1O)),2&o){const e=t.MAs(2),n=t.oxw(2);t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell||null==n.AppConfigJSON.ModuleSell.Promotion?null:n.AppConfigJSON.ModuleSell.Promotion.StrikethroughOriginalPrice)("ngIfElse",e)}}function gn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"tr",22),t.NdJ("contextmenu",function(r){const a=t.CHM(e),l=a.$implicit,m=a.index,f=t.oxw();return t.KtG(f.onContextMenu(r,l,m))}),t.TgZ(1,"td",23)(2,"input",24),t.NdJ("ngModelChange",function(r){const l=t.CHM(e).$implicit;return t.KtG(l.Splited=r)}),t.qZA(),t.TgZ(3,"i",25),t.NdJ("click",function(){const a=t.CHM(e).$implicit,l=t.oxw();return t.KtG(l.removeItem(a))}),t.qZA()(),t.YNc(4,Le,3,1,"td",5),t.TgZ(5,"td",26),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Quantity"))}),t.TgZ(6,"span"),t._uU(7),t.YNc(8,Be,1,0,"i",27),t.qZA(),t.YNc(9,$e,2,1,"i",28),t.YNc(10,ze,4,2,"p",29),t.YNc(11,je,2,1,"ng-container",30),t.YNc(12,Xe,1,1,"ng-template",null,31,t.W1O),t.YNc(14,tn,3,1,"p",5),t.YNc(15,en,4,1,"p",32),t.qZA(),t.YNc(16,nn,2,1,"td",33),t.YNc(17,on,1,1,"td",34),t.TgZ(18,"td",35),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a))}),t.qZA(),t.TgZ(19,"td",21)(20,"input",36),t.NdJ("ngModelChange",function(r){const l=t.CHM(e).$implicit;return t.KtG(l.SplitQuantity=r)}),t.qZA(),t.TgZ(21,"span",37),t._uU(22,"/"),t.qZA(),t.TgZ(23,"span",38),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Quantity"))}),t._uU(24),t.ALo(25,"number"),t.qZA(),t.YNc(26,rn,2,1,"span",5),t.YNc(27,an,2,1,"span",5),t.qZA(),t.YNc(28,sn,3,1,"td",5),t.TgZ(29,"td",39),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Price"))}),t.YNc(30,cn,2,0,"ng-container",30),t.YNc(31,un,3,2,"ng-template",null,40,t.W1O),t.qZA(),t.TgZ(33,"td",41),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a,"Discount"))}),t._uU(34),t.ALo(35,"number"),t.ALo(36,"number"),t.qZA(),t.TgZ(37,"td",39),t.NdJ("click",function(){const a=t.CHM(e).index,l=t.oxw();return t.KtG(l.openItemModal(a))}),t._uU(38),t.ALo(39,"number"),t.qZA()()}if(2&o){const e=s.$implicit,n=t.MAs(13),r=t.MAs(32),a=t.oxw();t.Q6J("cdkDragDisabled",a.disabledDragItem)("ngClass",5==a.state?"Split":""),t.xp6(2),t.Q6J("ngModel",e.Splited)("hidden",5!=a.state),t.xp6(1),t.Q6J("hidden",5==a.state||!a.role.DeleteItem||a.isRetrieve&&a.AuthorizeParkedOrdersItemDeletion&&"00000000-0000-0000-0000-000000000000"!=e.ID||a.isBill),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.RowNumberVisible),t.xp6(3),t.hij("",e.Variant.Name," "),t.xp6(1),t.Q6J("ngIf",e.PromotionGift),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.CategoryVisible),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.TaxVisible),t.xp6(1),t.Q6J("ngIf",e.SerialNote)("ngIfElse",n),t.xp6(3),t.Q6J("ngIf",!a.isEmpty(e.EntityID)),t.xp6(1),t.Q6J("ngIf","00000000-0000-0000-0000-000000000000"!=e.SalesID&&e.SalesID),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.ShowBrandItemCart),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.InventoryVisible),t.xp6(1),t.Q6J("innerHtml",e.Variant.Code,t.oJD),t.xp6(2),t.Q6J("hidden",!(5==a.state&&e.Splited))("ngModel",e.SplitQuantity),t.xp6(1),t.Q6J("hidden",!(5==a.state&&e.Splited)),t.xp6(3),t.Oqu(t.xi3(25,29,e.Quantity,"1.0-4")),t.xp6(2),t.Q6J("ngIf",e.UnitQuantity>1),t.xp6(1),t.Q6J("ngIf",e.VariantUnitQuantity>1),t.xp6(1),t.Q6J("ngIf",null==a.AppConfigJSON||null==a.AppConfigJSON.ModuleSell?null:a.AppConfigJSON.ModuleSell.Grid.UOMVisible),t.xp6(2),t.Q6J("ngIf",!a.role.PriceVisible)("ngIfElse",r),t.xp6(4),t.AsE(" ",0==e.Discount?"":t.lcZ(35,32,-1*e.Discount)+"%"," ",0==e.DiscountAmount?"":t.lcZ(36,34,-1*e.DiscountAmount)," "),t.xp6(4),t.hij(" ",a.role.PriceVisible?t.lcZ(39,36,e.Total):" - "," ")}}function mn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",56)(1,"button",57),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onReverse(a,!0))}),t._uU(2," Return "),t.qZA(),t.TgZ(3,"button",58),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onReverse(a,!1))}),t._uU(4,"Sales"),t.qZA(),t.TgZ(5,"button",57),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onSumPrice(a))}),t._uU(6," Merge / SUM Price "),t.qZA(),t.TgZ(7,"button",57),t.NdJ("click",function(){const a=t.CHM(e).item,l=t.oxw();return t.KtG(l.onBundlePrice(a))}),t._uU(8," Bundle Price "),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("disabled",!e.role.Return),t.xp6(4),t.Q6J("disabled",!e.role.BundlingPrice),t.xp6(2),t.Q6J("disabled",!e.role.BundlingPrice)}}let _n=(()=>{class o{constructor(e,n,r,a,l,m,f){(0,i.Z)(this,"_shoppingCartService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"cardContainer",void 0),(0,i.Z)(this,"cartItems",[]),(0,i.Z)(this,"posStorage",void 0),(0,i.Z)(this,"AppConfigJSON",new Y.A),(0,i.Z)(this,"state",void 0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"isRetrieve",!1),(0,i.Z)(this,"AuthorizeParkedOrdersItemDeletion",!1),(0,i.Z)(this,"isBill",!1),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"disabledDragItem",void 0),(0,i.Z)(this,"isRemoveItem",!1),(0,i.Z)(this,"isUpdateItem",!1),(0,i.Z)(this,"cartItemsSource",void 0),(0,i.Z)(this,"contextMenu",void 0),(0,i.Z)(this,"contextMenuPosition",{x:"0px",y:"0px"}),this._shoppingCartService=e,this._posService=n,this._outletService=r,this._orderProcessorService=a,this._matDialog=l,this._userRoleService=m,this._orderDataService=f,this.destroy$=new v.x,this.AppConfigJSON=this._posService.Data.AppConfigJSON,this.AuthorizeParkedOrdersItemDeletion=this.AppConfigJSON.ApplicationParkAndRetrieve.AccessControl.AuthorizeParkedOrdersItemDeletion,this.scrollToBottom()}ngOnInit(){this.subscribeTobservable(),this.checkDisabledDragItem()}ngAfterViewInit(){setTimeout(()=>{this.scrollToBottom()},2e3)}scrollToBottom(){this.cardContainer&&!this.isRemoveItem&&!this.isUpdateItem&&setTimeout(()=>{this.cardContainer.nativeElement.scrollTop=this.cardContainer.nativeElement.scrollHeight},1),this.isRemoveItem=!1,this.isUpdateItem=!1}SelectState(e){switch(e){case g.J.IsBill:this.isBill=!0;break;case g.J.IsRetrieve:this.isRetrieve=!0;break;default:this.isBill=!1,this.isRetrieve=!1}}subscribeTobservable(){this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.cartItems=e.CartItems,this.cartItemsSource=e.CartItems,this.scrollToBottom()}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.state=e.posState,this.SelectState(this.state)}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e})}checkDisabledDragItem(){this.disabledDragItem=!0===window.matchMedia("(pointer: coarse)").matches}isEmpty(e){return u.gT.IsEmpty(e)}getSalesName(e){return this._outletService.getSalesname(e)}getOutletName(e){return this._posService.getOutletName(e)}onContextMenu(e,n,r){e.preventDefault(),this.contextMenuPosition.x=e.clientX+"px",this.contextMenuPosition.y=e.clientY+"px",n.Index=r,this.contextMenu.menuData={item:n},this.contextMenu.openMenu()}drop(e){(0,B.bA)(this.cartItems,e.previousIndex,e.currentIndex)}onReverse(e,n){this.isUpdateItem=!0,n?e.Quantity>0&&(e.Quantity=-1*e.Quantity):e.Quantity<0&&(e.Quantity=-1*e.Quantity),this.isUpdateItem=!0,this._shoppingCartService.updateCartItem(e,e.Index)}onSumPrice(e){this.isUpdateItem=!0;let n=0;this.cartItems.forEach((r,a)=>{n+=r.Quantity*r.Price*(100-r.Discount)/100-r.DiscountAmount,r.Price=0}),e.Price=n/e.Quantity,this._shoppingCartService.updateCartItem(e,e.Index)}onBundlePrice(e){let n=0;this.cartItems.forEach((r,a)=>{a!=e.Index&&(n+=r.Quantity*r.Price*(100-r.Discount)/100-r.DiscountAmount,r.Price=0)}),0==e.Price&&(e.Price=n/e.Quantity),this._shoppingCartService.updateCartItem(e,e.Index)}removeItem(e){this.isRemoveItem=!0,this._shoppingCartService.deleteCartItem(e)}openItemModal(e,n){this.isUpdateItem=!0,this._matDialog.open(L.k,{data:{index:e,focus:n}})}sortItemByCode(e){const n=this.cartItems.slice();e.active&&""!==e.direction?(this.cartItems=n.sort((r,a)=>this.compare(r.Variant.Code,a.Variant.Code,"asc"===e.direction)),this._orderDataService.Data.CartItems=this.cartItems):this.cartItems=this.cartItemsSource}compare(e,n,r){return(e<n?-1:1)*(r?1:-1)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(K.F),t.Y36(x.W),t.Y36(P.o),t.Y36(M.d),t.Y36(h.uw),t.Y36(T.J),t.Y36(S.q))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart-display"]],viewQuery:function(e,n){if(1&e&&(t.Gf(Ee,5),t.Gf(w.p6,7)),2&e){let r;t.iGM(r=t.CRH())&&(n.cardContainer=r.first),t.iGM(r=t.CRH())&&(n.contextMenu=r.first)}},decls:30,vars:10,consts:[[1,"row","g-0","cart-table"],[1,"col"],["cardContainer",""],["matSort","",1,"table",3,"matSortChange"],[2,"width","18px"],[4,"ngIf"],[1,"text-start"],["style","cursor: pointer; width: 60px",4,"ngIf"],["mat-sort-header","Code","arrowPosition","before",2,"cursor","pointer","width","60px"],[1,"fas","fa-sort-amount-down","ms-1"],[1,"text-end",2,"width","50px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","20px"],[1,"text-end",2,"width","85px"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",3,"cdkDragDisabled","ngClass","contextmenu",4,"ngFor","ngForOf"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["contextMenu","matMenu"],["matMenuContent",""],[2,"cursor","pointer","width","60px"],[1,"text-end"],["cdkDrag","",3,"cdkDragDisabled","ngClass","contextmenu"],[1,"cursor"],["type","checkbox",3,"ngModel","hidden","ngModelChange"],["aria-hidden","true","matTooltipPosition","above","matTooltip","Click to Remove",1,"fa","fa-xmark","text-danger",3,"hidden","click"],[1,"text-start",3,"click"],["class","fa-solid fa-gift",4,"ngIf"],["class","ms-3",4,"ngIf"],["class","fst-italic m-0",4,"ngIf"],[4,"ngIf","ngIfElse"],["DEFAULT_NOTE",""],["class","text-success fst-italic",4,"ngIf"],[3,"click",4,"ngIf"],[3,"innerHtml","click",4,"ngIf"],[1,"text-end",3,"innerHtml","click"],["type","text","autoNum","",1,"text-end",2,"width","30px",3,"hidden","ngModel","ngModelChange"],[3,"hidden"],[3,"click"],[1,"text-end",3,"click"],["PRICEVISIBLE",""],[1,"text-end","text-danger",3,"click"],[1,"fa-solid","fa-gift"],[1,"ms-3"],[1,"fst-italic","m-0"],["NotTaxable",""],[1,"text-success"],[1,"text-danger"],[1,"special-TinyMCE","m-0","fst-italic",3,"innerHtml"],["class","special-TinyMCE m-0 fst-italic",3,"innerHtml",4,"ngIf"],[1,"text-warning"],[1,"text-success","fst-italic"],[3,"innerHtml","click"],["NOT_STRIKETHROUGHT",""],["class","text-decoration-line-through text-danger",4,"ngIf"],[1,"text-decoration-line-through","text-danger"],["data-cy","ctx-menu-item"],["mat-menu-item","",3,"disabled","click"],["mat-menu-item","",3,"click"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1,2)(3,"table",3),t.NdJ("matSortChange",function(a){return n.sortItemByCode(a)}),t.TgZ(4,"thead")(5,"tr"),t._UZ(6,"th",4),t.YNc(7,Fe,1,0,"th",5),t.TgZ(8,"th",6),t._uU(9,"Name"),t.qZA(),t.YNc(10,Ye,2,0,"th",7),t.YNc(11,He,2,0,"th",7),t.TgZ(12,"th",8),t._uU(13," Code "),t._UZ(14,"i",9),t.qZA(),t.TgZ(15,"th",10),t._uU(16,"Qty"),t.qZA(),t.YNc(17,Ke,1,0,"th",11),t.TgZ(18,"th",12),t._uU(19,"Price"),t.qZA(),t.TgZ(20,"th",13),t._uU(21,"Disc"),t.qZA(),t.TgZ(22,"th",14),t._uU(23,"Total"),t.qZA()()(),t.TgZ(24,"tbody",15),t.NdJ("cdkDropListDropped",function(a){return n.drop(a)}),t.YNc(25,gn,40,38,"tr",16),t.qZA()()()(),t._UZ(26,"div",17),t.TgZ(27,"mat-menu",null,18),t.YNc(29,mn,9,3,"ng-template",19),t.qZA()),2&e){const r=t.MAs(28);t.xp6(7),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.RowNumberVisible),t.xp6(3),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.ShowBrandItemCart),t.xp6(1),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.InventoryVisible),t.xp6(6),t.Q6J("ngIf",null==n.AppConfigJSON||null==n.AppConfigJSON.ModuleSell?null:n.AppConfigJSON.ModuleSell.Grid.UOMVisible),t.xp6(8),t.Q6J("ngForOf",n.cartItems),t.xp6(1),t.Udp("left",n.contextMenuPosition.x)("top",n.contextMenuPosition.y),t.Q6J("matMenuTriggerFor",r)}},dependencies:[p.mk,p.sg,p.O5,w.VK,w.OP,w.KA,w.p6,_.Fj,_.Wl,_.JJ,_.On,B.Wj,B.Zt,vt.b,ot.YE,ot.nU,D.gM,p.JJ],styles:["div.row.cart-table[_ngcontent-%COMP%]{border-left:solid 1px #cfcfcf}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%]{overflow:auto;height:250px}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#fbfbf7;border-left:none}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.75rem;padding:5px!important}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;padding:6px 5px;border-bottom:1px solid #cfcfcf}div.row.cart-table[_ngcontent-%COMP%] div.col[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-right:0} .hide-arrow .mat-sort-header-arrow{color:#fff}"]})),o})();var fn=c(70075),hn=c(23339),Cn=c(30420),bn=c(31853),k=c(29990),Pt=c(82707),$=c(88796);function vn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",30),t._UZ(1,"i",31),t.TgZ(2,"ng-select",32),t.NdJ("change",function(r){t.CHM(e);const a=t.oxw();return t.KtG(a.updateTax(r))}),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(2),t.Q6J("clearable",!1)("items",e.Taxes)("ngModel",e.posData.Order.TaxTypeID)}}function xn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",33),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openDiscountModal())}),t._UZ(1,"i",34),t.TgZ(2,"span"),t._uU(3,"Discount"),t.qZA()()}}function Pn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",null==e.posData?null:e.posData.Order.Discount,"%) ")}}function yn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",t.xi3(2,1,null==e.posData?null:e.posData.Order.Discount,"1.0-4"),"%)")}}function On(o,s){if(1&o&&(t.TgZ(0,"tr",35)(1,"th",36),t._uU(2),t.YNc(3,Pn,2,1,"span",11),t.YNc(4,yn,3,4,"span",11),t.qZA(),t._UZ(5,"td",14),t.ALo(6,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(2),t.hij(" ",null==e.AppConfigJSON?null:e.AppConfigJSON.CorePrint.Alias.Discount1," "),t.xp6(1),t.Q6J("ngIf",e.isIgnoreDecimalDisc1),t.xp6(1),t.Q6J("ngIf",!(null!=e.AppConfigJSON&&e.AppConfigJSON.PrintConfigInvoice.Footer.DiscountIgnoredDecimal)),t.xp6(1),t.Q6J("innerHtml",t.lcZ(6,4,-1*e._cashierCalculatorService.Discount1Amount),t.oJD)}}function Mn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij("(",null==e.posData?null:e.posData.Order.Discount2,"%)")}}function Dn(o,s){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.hij(" (",t.xi3(2,1,null==e.posData?null:e.posData.Order.Discount2,"1.0-4"),"%) ")}}function Sn(o,s){if(1&o&&(t.TgZ(0,"tr")(1,"th",36),t._uU(2),t.YNc(3,Mn,2,1,"span",11),t.YNc(4,Dn,3,4,"span",11),t.qZA(),t._UZ(5,"td",14),t.ALo(6,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(2),t.hij(" ",null==e.AppConfigJSON?null:e.AppConfigJSON.CorePrint.Alias.Discount2," "),t.xp6(1),t.Q6J("ngIf",e.isIgnoreDecimalDisc2),t.xp6(1),t.Q6J("ngIf",!(null!=e.AppConfigJSON&&e.AppConfigJSON.PrintConfigInvoice.Footer.DiscountIgnoredDecimal)),t.xp6(1),t.Q6J("innerHtml",t.lcZ(6,4,-1*e._cashierCalculatorService.Discount2Amount),t.oJD)}}function Zn(o,s){if(1&o&&(t.TgZ(0,"tr"),t._UZ(1,"th",13)(2,"td",37),t.ALo(3,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("innerHtml",null==e._cashierCalculatorService||null==e._cashierCalculatorService.tax?null:e._cashierCalculatorService.tax.Label,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,2,e._cashierCalculatorService.TaxAmount),t.oJD)}}function Tn(o,s){if(1&o&&(t.TgZ(0,"tr")(1,"th",36),t._uU(2,"Deposit"),t.qZA(),t._UZ(3,"td",38),t.ALo(4,"number"),t.qZA()),2&o){const e=t.oxw();t.xp6(3),t.Q6J("innerHtml",t.lcZ(4,1,-1*(null==e.posData?null:e.posData.Order.Deposit)),t.oJD)}}function In(o,s){if(1&o&&(t.TgZ(0,"div",39)(1,"strong"),t._uU(2,"Fulfillment From: "),t.qZA(),t.TgZ(3,"span"),t._uU(4),t.qZA()()),2&o){const e=t.oxw();t.xp6(4),t.Oqu(e.getOutletName(e.posData.Action.DeliveryEntityID))}}const kn=function(o){return{"bg-gradient-warning":o}};function An(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",40),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.openFullfillmentModal())}),t._UZ(1,"i",41),t.TgZ(2,"span"),t._uU(3,"Fulfillment"),t.qZA()()}if(2&o){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,kn,e.warningFullfillment))}}let wn=(()=>{class o{handleF8(){this._matDialog.openDialogs&&this._matDialog.openDialogs.length>0||this.payButtonClicked()}constructor(e,n,r,a,l,m,f,C,y,O){(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_cashierCalculatorService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_toastr",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_promotionEventService",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"posData",void 0),(0,i.Z)(this,"AppConfigJSON",void 0),(0,i.Z)(this,"Taxes",void 0),(0,i.Z)(this,"discountPromotion",[]),(0,i.Z)(this,"onlineStatus",void 0),(0,i.Z)(this,"taxInit",void 0),(0,i.Z)(this,"taxTypeID",void 0),(0,i.Z)(this,"isIgnoreDecimalDisc1",void 0),(0,i.Z)(this,"isIgnoreDecimalDisc2",void 0),(0,i.Z)(this,"warningFullfillment",void 0),(0,i.Z)(this,"isDepositEnabled",void 0),this._matDialog=e,this._orderDataService=n,this._cashierCalculatorService=r,this._posService=a,this._toastr=l,this._orderProcessorService=m,this._outletService=f,this._onlineStatusService=C,this._userRoleService=y,this._promotionEventService=O,this.destroy$=new v.x,this.Taxes=this._posService.Data.Taxes,this.AppConfigJSON=this._posService.Data.AppConfigJSON,this.isDepositEnabled=this.AppConfigJSON.ApplicationParkAndRetrieve.Deposit.Enabled}ngOnInit(){this.subscribeToObservable(),this.initOrderTypeID()}subscribeToObservable(){this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e,this.setStatusIgnoreDecimalDisc(),this.initOrderTypeID(),this.warningFullfillment=u.gT.IsEmpty(e.Action.DeliveryEntityID)}),this._onlineStatusService.getOnlineStatus$().subscribe(e=>{this.onlineStatus=e}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{let n=e.Promotion.filter(r=>"Discount"===r.PromotionTypeString);this.discountPromotion=n})}setStatusIgnoreDecimalDisc(){this.isIgnoreDecimalDisc1=this.checkIgnoreDecimalDisc(this.posData.Order.Discount),this.isIgnoreDecimalDisc2=this.checkIgnoreDecimalDisc(this.posData.Order.Discount2)}initOrderTypeID(){0==this.posData.Order.TypeID&&(this.posData.Order.TypeID=this._posService.Data.PoTypes[0].ID)}updateTax(e){this._orderDataService.Data.Order.TaxTypeID=e.ID,this._cashierCalculatorService.tax=e,this._orderDataService.pushNewValue()}payButtonClicked(){this.isCartNotEmpty()&&this.validateEmptySalesOrder()&&this.validateNegativePayment()&&this.isSalesPersonValid()&&this.validateCustomerID()&&this.isCustomerRequired()&&this.validatePromotionDiscount()&&this.OpenPaymentModal()}validateNegativePayment(){let e=!0;return 0==this.AppConfigJSON.ModuleSell.PaymentDialog.MinusPaymentAllowed&&this._cashierCalculatorService.Data<0&&(e=!1,this._toastr.warning("You are not allowed to process this transaction because the total amount is less than zero","Warning!")),e}validatePromotionDiscount(){let n=(this._outletService.Data.Promotion?this._outletService.Data.Promotion:[]).find(m=>m.TypeID===Pt.qe.Discount),a=this._promotionEventService.selectedPromotion,l=!0;return this.AppConfigJSON.ModuleSell.MandatoryActiveDiscount&&n&&(a?a.TypeID!=Pt.qe.Discount&&(l=!1):l=!1),0==l&&(this._matDialog.open(pt.t,{id:"promotion-event"}),this._toastr.warning("You need to apply Discount promotion","Required Promotion")),l}OpenPaymentModal(){this._matDialog.open(fn.n,{id:"ModalPayment",disableClose:!0}).afterClosed().pipe((0,d.R)(this.destroy$)).subscribe()}isCartNotEmpty(){return!(this.posData.CartItems.length<1&&(this._toastr.warning(k.g.emptyPOItem,"Warning!"),1))}validateEmptySalesOrder(){return!u.gT.IsEmpty(this.posData.Order.Number)||(this._toastr.warning(k.g.emptyOrderNumber,"Warning!"),!1)}isSalesPersonValid(){return!this.AppConfigJSON.ModuleSell.Header.SalesPersonRequired||this.posData.Order.SalesID!=u.gT.GuidEmpty&&null!=this.posData.Order.SalesID||!!this.posData.CartItems.every(e=>u.gT.IsNotEmpty(e.SalesID))||(this._toastr.warning(k.g.emptySalesPerson,"Warning!"),!1)}isCustomerRequired(){return!(this.AppConfigJSON.ModuleSell.Header.CustomerRequired&&this.onlineStatus&&u.gT.IsEmpty(this.posData.Order.CustomerID)&&(this._toastr.warning(k.g.emptyCustomer,"Warning!"),1))}validateCustomerID(){if(u.gT.IsEmpty(this.posData.Order.CustomerID)){let n=this._orderProcessorService.Data.InputTextValue;if(u.gT.IsNotEmpty(n)&&(this._toastr.warning("Customer is not Saved","Warning"),this.AppConfigJSON.ModuleSell.Customer.QuickAddEnabled))return this.openCustomerModal(n),!1}return!0}openCustomerModal(e){this._matDialog.open(ht.A,{data:{name:e},autoFocus:!1}).afterClosed().subscribe(n=>{n&&this.OpenPaymentModal()})}openDiscountModal(){this._matDialog.open(xt)}openClearOrderModal(){this._matDialog.open(hn.U)}openNotesModal(){this._matDialog.open(Cn.$,{width:"45%"})}openFullfillmentModal(){this._matDialog.open(bn.D)}getOutletName(e){if(!u.gT.IsEmpty(e))return this._posService.getOutletName(e)}isFulfillmentVisible(e,n){return!u.gT.IsEmpty(n)&&e!=n}checkIgnoreDecimalDisc(e){return this.AppConfigJSON.PrintConfigInvoice.Footer.DiscountIgnoredDecimal&&e%1==0}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(h.uw),t.Y36(S.q),t.Y36(H.J),t.Y36(x.W),t.Y36(U._W),t.Y36(M.d),t.Y36(P.o),t.Y36(J.q),t.Y36(T.J),t.Y36(X.D))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart-action"]],hostBindings:function(e,n){1&e&&t.NdJ("keydown.F8",function(a){return n.handleF8(a)},!1,t.Jf7)},decls:52,vars:28,consts:[[1,"row","g-0","cart-footer","justify-content-between"],[1,"col-auto","align-self-center","mobile-view"],[1,"row","g-0"],["class","col-auto mx-5 d-flex flex-row",4,"ngIf"],[1,"col-auto"],["data-cy","Discount","class","btn btn-gray fw-normal disc",3,"click",4,"ngIf"],[1,"col-auto","summary","mobile-view"],[1,"table",3,"hidden"],[1,"table-light","border-top-0",2,"vertical-align","middle","line-height","30px !important"],[1,"text-end","border-top-0",2,"width","100px",3,"innerHtml"],["context-menu","ctrl.MenuDiscount",4,"ngIf"],[4,"ngIf"],[3,"hidden"],[1,"table-light",2,"vertical-align","middle","line-height","30px !important",3,"innerHtml"],[1,"text-danger","text-end","text-danger",3,"innerHtml"],[1,"text-end",3,"ngClass","innerHtml"],[1,"mt-5","row","g-0","action-buttons","justify-content-between"],[1,"col-auto","mobile-view"],[1,"position-relative"],["class","cashier-note-arrow arrow-box-right",4,"ngIf"],["class","btn btn-gray mobile-view","data-cy","Fulfillment",3,"ngClass","click",4,"ngIf"],[1,"col-auto","mobile-view","ms-3"],["data-cy","Note",1,"btn","btn-gray","w-100",3,"click"],[1,"fa-regular","fa-note-sticky","pe-2"],[1,"btn","btn-gray","mobile-view",3,"hidden","click"],[1,"fa-regular","fa-rectangle-xmark","pe-2"],["data-cy","PaySales",1,"ms-auto","btn","btn-success","pay","mobile-view",3,"hidden","click"],[1,"d-flex"],[1,"ms-auto"],[1,"position-absolute","fst-italic","right-bottom"],[1,"col-auto","mx-5","d-flex","flex-row"],["aria-hidden","true",1,"fa","fa-tags","d-flex","align-items-center","me-2"],["bindLabel","Label","bindValue","ID","placeholder","Tax","data-cy","Tax",2,"width","125px",3,"clearable","items","ngModel","change"],["data-cy","Discount",1,"btn","btn-gray","fw-normal","disc",3,"click"],["aria-hidden","true",1,"fa","fa-tags","pe-2"],["context-menu","ctrl.MenuDiscount"],[1,"table-light",2,"vertical-align","middle","line-height","30px !important"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"],[1,"cashier-note-arrow","arrow-box-right"],["data-cy","Fulfillment",1,"btn","btn-gray","mobile-view",3,"ngClass","click"],[1,"fa","fa-truck","pe-2"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t.YNc(3,vn,3,3,"div",3),t.TgZ(4,"div",4),t.YNc(5,xn,4,0,"a",5),t.qZA()()(),t.TgZ(6,"div",6)(7,"table",7)(8,"tbody")(9,"tr")(10,"th",8),t._uU(11,"Amount"),t.qZA(),t._UZ(12,"td",9),t.ALo(13,"number"),t.qZA(),t.YNc(14,On,7,6,"tr",10),t.YNc(15,Sn,7,6,"tr",11),t.TgZ(16,"tr",12),t._UZ(17,"th",13)(18,"td",14),t.ALo(19,"number"),t.qZA(),t.YNc(20,Zn,4,4,"tr",11),t.TgZ(21,"tr",12),t._UZ(22,"th",13)(23,"td",15),t.ALo(24,"number"),t.qZA(),t.YNc(25,Tn,5,3,"tr",11),t.qZA()()()(),t.TgZ(26,"div",16)(27,"div",17)(28,"div",18),t.YNc(29,In,5,1,"div",19),t.YNc(30,An,4,3,"a",20),t.qZA()(),t.TgZ(31,"div",21)(32,"a",22),t.NdJ("click",function(){return n.openNotesModal()}),t._UZ(33,"i",23),t.TgZ(34,"span"),t._uU(35,"Note"),t.qZA()()(),t.TgZ(36,"div",21)(37,"a",24),t.NdJ("click",function(){return n.openClearOrderModal()}),t._UZ(38,"i",25),t.TgZ(39,"span"),t._uU(40,"Clear"),t.qZA()()(),t.TgZ(41,"div",21)(42,"a",26),t.NdJ("click",function(){return n.payButtonClicked()}),t.TgZ(43,"div",27)(44,"strong"),t._uU(45,"Pay:"),t.qZA(),t.TgZ(46,"span",28),t._uU(47),t.ALo(48,"number"),t.qZA()(),t.TgZ(49,"small",29),t._uU(50,"(F8)"),t.qZA()()()(),t._UZ(51,"div")),2&e&&(t.xp6(3),t.Q6J("ngIf",n.role.Tax),t.xp6(2),t.Q6J("ngIf",n.role.Discount),t.xp6(2),t.Q6J("hidden",!n.role.PriceVisible),t.xp6(5),t.Q6J("innerHtml",t.lcZ(13,20,n._cashierCalculatorService.GrossTotal),t.oJD),t.xp6(2),t.Q6J("ngIf",0!=(null==n.posData?null:n.posData.Order.Discount)),t.xp6(1),t.Q6J("ngIf",0!=(null==n.posData?null:n.posData.Order.Discount2)),t.xp6(1),t.Q6J("hidden",0==(null==n.posData?null:n.posData.Order.DiscountAmount)),t.xp6(1),t.Q6J("innerHtml",(null==n.AppConfigJSON?null:n.AppConfigJSON.CorePrint.Alias.DiscountAmount)+" "+(null==n._cashierCalculatorService?null:n._cashierCalculatorService.currencySymbol),t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(19,22,-1*(null==n.posData?null:n.posData.Order.DiscountAmount)),t.oJD),t.xp6(2),t.Q6J("ngIf",null==n._cashierCalculatorService||null==n._cashierCalculatorService.tax?null:n._cashierCalculatorService.tax.Rate),t.xp6(1),t.Q6J("hidden",0==(null==n.posData?null:n.posData.Invoice.SurchargePcg)),t.xp6(1),t.Q6J("innerHtml","SURCHARGE "+(null==n.posData?null:n.posData.Invoice.SurchargePcg)+" %",t.oJD),t.xp6(1),t.Q6J("ngClass",(null==n.posData?null:n.posData.Invoice.SurchargePcg)<0?"text-danger":"")("innerHtml",t.lcZ(24,24,n._cashierCalculatorService.SurchargeAmount),t.oJD),t.xp6(2),t.Q6J("ngIf",(null==n.posData?null:n.posData.Order.Deposit)>0&&n.isDepositEnabled),t.xp6(4),t.Q6J("ngIf",n.isFulfillmentVisible(n.posData.Order.EntityID,n.posData.Action.DeliveryEntityID)),t.xp6(1),t.Q6J("ngIf",n.role.Shipping),t.xp6(7),t.Q6J("hidden",n.role.ClearCartRestriction),t.xp6(5),t.Q6J("hidden",!n.role.Payment),t.xp6(5),t.Oqu(n.role.PriceVisible?t.lcZ(48,26,n._cashierCalculatorService.Data):"-"))},dependencies:[p.mk,p.O5,$.w9,_.JJ,_.On,p.JJ],styles:['div.row.cart-footer[_ngcontent-%COMP%]{border-top:solid 1px #cfcfcf;min-height:85px}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.75rem;border-left:solid 1px #cfcfcf;border-bottom:solid 1px #cfcfcf;line-height:16px!important}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:5px 8px}div.row.cart-footer[_ngcontent-%COMP%] div.summary[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:5px}div.row.cart-footer[_ngcontent-%COMP%] .disc[_ngcontent-%COMP%]{padding-top:7px;padding-bottom:6px}div.row.action-buttons[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{font-size:1.125rem;padding:15px 16px}div.row.action-buttons[_ngcontent-%COMP%] .btn-success[_ngcontent-%COMP%]{width:195px}div.row.action-buttons[_ngcontent-%COMP%] .right-bottom[_ngcontent-%COMP%]{font-size:.625rem;right:4px}.cashier-note-arrow[_ngcontent-%COMP%]{position:absolute;min-width:130px;max-width:180px;min-height:55px;background-color:#ffffe1!important;right:110%;top:0%;z-index:1;text-align:center;padding:8px 2px;border:1px solid #bbbbbb!important}.cashier-note-arrow[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-style:italic}.cashier-note-arrow[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-top:3px;font-family:Roboto Slab,serif;display:block;text-transform:uppercase}.cashier-note-arrow[_ngcontent-%COMP%]:after{border-left-color:#ffffe1!important}.arrow-box-right[_ngcontent-%COMP%]:before{border-width:6px!important;margin-top:-6px!important}@media (max-width: 575.98px){.mobile-view[_ngcontent-%COMP%]{width:100%!important;margin-top:5px}}.arrow-box-right[_ngcontent-%COMP%]{position:absolute;background:white;border:2px solid #bbbbbb;border-radius:.25rem}.arrow-box-right[_ngcontent-%COMP%]:after, .arrow-box-right[_ngcontent-%COMP%]:before{left:100%;top:50%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-right[_ngcontent-%COMP%]:after{border-color:#0000;border-left-color:#fff;border-width:5px;margin-top:-5px}.arrow-box-right[_ngcontent-%COMP%]:before{border-color:#c2e1f500;border-left-color:#bbb;border-width:8px;margin-top:-8px}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #d6d6d6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}']})),o})(),Nn=(()=>{class o{constructor(){}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-cart"]],decls:4,vars:0,consts:[[1,"cashier"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"pos-cart-header")(2,"pos-cart-display")(3,"pos-cart-action"),t.qZA())},dependencies:[Re,_n,wn],styles:['@media print{.cashier[_ngcontent-%COMP%], pos-quick-key[_ngcontent-%COMP%], pos-header[_ngcontent-%COMP%], pos-toolbar[_ngcontent-%COMP%]{display:none}}.quickKey[_ngcontent-%COMP%]{margin-right:10px}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-webkit-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-ms-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.quickKey[_ngcontent-%COMP%]{width:420px;margin-right:10px}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.cart[_ngcontent-%COMP%]{width:570px}@media only screen and (max-width: 1280px){input[id=ContactID][_ngcontent-%COMP%]{width:135px}}@media only screen and (max-width: 1215px){input[id=ContactID][_ngcontent-%COMP%]{width:120px}}@media only screen and (max-width: 1185px){input[id=ContactID][_ngcontent-%COMP%]{width:140px}} .hg-theme-default .hg-button{height:70px!important;font-size:16px!important} .hg-button-bksp{width:21px} .hg-button[data-skbtn="{enter}"][_ngcontent-%COMP%]{width:90px}.cashier[_ngcontent-%COMP%]{max-width:37rem;min-width:34rem}@media (max-width: 1200px){.cashier[_ngcontent-%COMP%]{width:40rem}}@media (max-width: 1172px){.cashier[_ngcontent-%COMP%]{width:30rem}}']})),o})();var Jn=c(11989),Un=c(61135);let yt=(()=>{class o{get _appConfigJSON(){return this._posService.Data.AppConfigJSON}constructor(e,n,r,a){(0,i.Z)(this,"_cartService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"Items",void 0),(0,i.Z)(this,"_quickKeySubject",new Un.X(new Jn.AM)),(0,i.Z)(this,"quickKey$",this._quickKeySubject.asObservable()),this._cartService=e,this._posService=n,this._orderDataService=r,this._matDialog=a,this._orderDataService.Data$.subscribe(l=>{this.Items=l.CartItems})}addQuickKeyItem(e){this._cartService.addCartItemById(e).then(()=>{this._appConfigJSON.ModuleSell.ProductDialog.OpenOnNewItemAdded&&this._matDialog.open(L.k,{data:{index:this.Items.length-1}})}).catch(n=>{window.alert(n)})}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.LFG(K.F),t.LFG(x.W),t.LFG(S.q),t.LFG(h.uw))}),(0,i.Z)(o,"\u0275prov",t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"})),o})();var N=c(3848);function Qn(o,s){if(1&o&&t._UZ(0,"img",17),2&o){const e=t.oxw().$implicit;t.Q6J("src",e.ImageURLClient.indexOf("cloudinary")>-1?"https:"+e.ImageURLClient:e.ImageURLClient,t.LSH)}}function qn(o,s){if(1&o&&(t.TgZ(0,"p"),t._uU(1),t.ALo(2,"slice"),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.Dn7(2,1,e.Display,0,3))}}function Rn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",13)(1,"a",14),t.NdJ("click",function(){const a=t.CHM(e).$implicit,l=t.oxw(3);return t.KtG(l.select(a))}),t.YNc(2,Qn,1,1,"img",15),t.YNc(3,qn,3,5,"p",16),t.TgZ(4,"small"),t._uU(5),t.ALo(6,"slice"),t.qZA()()()}if(2&o){const e=s.$implicit;t.xp6(2),t.Q6J("ngIf",e.ImageURLClient),t.xp6(1),t.Q6J("ngIf",!e.ImageURLClient),t.xp6(2),t.Oqu(t.Dn7(6,3,e.Display,0,36))}}const Ot=function(){return["/menu/Outlets/Master/Quick_Key_Templates/Form"]},En=function(o){return{ID:o}};function Fn(o,s){if(1&o&&(t.TgZ(0,"mat-tab",6)(1,"div",7)(2,"div",8),t.YNc(3,Rn,7,7,"div",9),t.TgZ(4,"div",10)(5,"a",11),t._UZ(6,"i",12),t.qZA()()()()()),2&o){const e=s.$implicit,n=t.oxw(2);t.Q6J("label",e.Name),t.xp6(3),t.Q6J("ngForOf",e.Items),t.xp6(2),t.Q6J("routerLink",t.DdM(4,Ot))("queryParams",t.VKq(5,En,n.quickKey.ID))}}function Yn(o,s){if(1&o&&(t.TgZ(0,"mat-tab-group",4),t.YNc(1,Fn,7,7,"mat-tab",5),t.qZA()),2&o){const e=t.oxw();t.Q6J("disableRipple",!0)("hidden",e.subQuickKey),t.xp6(1),t.Q6J("ngForOf",e.quickKey.Groups)}}function Hn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",13)(1,"a",14),t.NdJ("click",function(){const a=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.selectChild(a.ID))}),t.TgZ(2,"p"),t._uU(3),t.ALo(4,"limitTo"),t.qZA(),t.TgZ(5,"small"),t._uU(6),t.ALo(7,"limitTo"),t.qZA()()()}if(2&o){const e=s.$implicit;t.xp6(3),t.Oqu(t.xi3(4,2,e.Model,3)),t.xp6(3),t.Oqu(t.xi3(7,5,e.Model,30))}}function Kn(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.back())}),t.TgZ(2,"div",20),t._UZ(3,"i",21),t.qZA(),t.TgZ(4,"div",22)(5,"b"),t._uU(6),t.qZA()()(),t.TgZ(7,"div",23),t.YNc(8,Hn,8,8,"div",9),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(6),t.hij(" ",e.subQuickKey.Name," "),t.xp6(2),t.Q6J("ngForOf",e.subQuickKey.Items)}}const Ln=function(o){return{OutletID:o}};function Bn(o,s){if(1&o&&(t.TgZ(0,"a",24)(1,"strong"),t._uU(2,"QUICK KEYS UNCONFIGURED"),t.qZA(),t._UZ(3,"i",25),t.TgZ(4,"span"),t._uU(5,"Click here to setup your Quick keys"),t.qZA()()),2&o){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,Ot))("queryParams",t.VKq(3,Ln,e.entityID))}}const $n=function(o){return{"no-quick-key":o}};let Gn=(()=>{class o{constructor(e,n){(0,i.Z)(this,"_quickKeyService",void 0),(0,i.Z)(this,"_outletRegisterService",void 0),(0,i.Z)(this,"data",void 0),(0,i.Z)(this,"entityID",void 0),(0,i.Z)(this,"quickKey",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"subQuickKey",void 0),(0,i.Z)(this,"NextProductID",void 0),this._quickKeyService=e,this._outletRegisterService=n,this.destroy$=new v.x}ngOnInit(){this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._outletRegisterService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.entityID=e.EntityID,this.setQuickey(e.QuickKeyPack)})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}setQuickey(e){if(e){let n;e.Groups&&0!==e.Groups.length&&(n=e.Groups),this.quickKey=n?e:null}}addQuickKeyItem(e){this._quickKeyService.addQuickKeyItem(e)}selectChild(e){this.addQuickKeyItem(e),this.back(),this.openNextProduct(this.NextProductID)}select(e){this.NextProductID=e.NextProductID,!e.Children||e.Children.length<1?this.selectChild(e.ItemID):1==e.Children.length?this.selectChild(e.Children[0].ID):this.subQuickKey={Items:e.Children,Name:e.Display}}openNextProduct(e){u.gT.IsNotEmpty(e)&&this.data.Groups.forEach(n=>{const r=n.Items.find(a=>a.ProductID==e);null!=r&&r.Children.length>1&&(this.NextProductID=r.NextProductID,this.subQuickKey={Items:r.Children,Name:r.Display})})}back(){delete this.subQuickKey}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(yt),t.Y36(P.o))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-quick-key"]],inputs:{data:"data"},decls:5,vars:6,consts:[[1,"quickKeys",3,"ngClass"],["animationDuration","0ms",3,"disableRipple","hidden",4,"ngIf","ngIfElse"],["class","container",4,"ngIf"],["noQuickKey",""],["animationDuration","0ms",3,"disableRipple","hidden"],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[1,"container","tabItems"],[1,"row","g-0"],["class","col-3 column",4,"ngFor","ngForOf"],[1,"col-3","column","add"],[3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-circle-plus","fa-5x","d-flex","align-items-center","justify-content-center","bg-white","h-100","text-primary"],[1,"col-3","column"],[3,"click"],[3,"src",4,"ngIf"],[4,"ngIf"],[3,"src"],[1,"container"],[1,"row","g-0","border","align-items-center","variants-header","cursor",3,"click"],[1,"col-auto","border-end","py-5","px-7"],["aria-hidden","true",1,"fa","fa-arrow-left"],[1,"col","text-center","fw-bold","text-uppercase","h5"],[1,"tabItems","row","g-0"],["id","LinkConfigureQuickkey","target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-regular","fa-hand-pointer"]],template:function(e,n){if(1&e&&(t.TgZ(0,"section",0),t.YNc(1,Yn,2,3,"mat-tab-group",1),t.YNc(2,Kn,9,2,"div",2),t.YNc(3,Bn,6,5,"ng-template",null,3,t.W1O),t.qZA()),2&e){const r=t.MAs(4);t.Q6J("ngClass",t.VKq(4,$n,!n.quickKey)),t.xp6(1),t.Q6J("ngIf",n.quickKey)("ngIfElse",r),t.xp6(1),t.Q6J("ngIf",n.subQuickKey)}},dependencies:[p.mk,p.sg,p.O5,N.uX,N.SP,b.rH,p.OU,Z.OI],styles:['.btn-add[_ngcontent-%COMP%]{-webkit-border-radius:50%;-moz-border-radius:50%;padding:6px 10px;cursor:pointer;right:-14px;top:5px;border:solid 1px #dddddd}section.quickKeys.no-quick-key[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Cashier/no-quick-key.png);background-repeat:no-repeat;height:544px;position:relative}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:80px;width:80px;display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #dddddd}.quickKeys[_ngcontent-%COMP%] .row.g-0.border.align-items-center.variants-header.cursor[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}.btn-add[_ngcontent-%COMP%]{-webkit-border-radius:50%;-moz-border-radius:50%;padding:6px 10px;cursor:pointer;right:-14px;top:5px;border:solid 1px #DDDDDD}section.quickKeys.no-quick-key[_ngcontent-%COMP%]{background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Cashier/no-quick-key.png);background-repeat:no-repeat;height:544px}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%]{border-bottom:0px;display:flex;border-radius:3px;cursor:pointer}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]{background:#ffffff;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#eeeeee",GradientType=0);height:44px;max-height:44px;overflow:hidden;color:#aaa!important;font-size:14px;text-decoration:none;font-weight:700;outline:none;text-transform:uppercase;text-align:center;min-width:25%;display:flex;justify-content:center}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{align-self:center;text-align:center}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:last-child{border-right:none}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n){border-right:none}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:first-child{border-left:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(-n+4){border-right:1px solid #cfcfcf;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+1){border-left:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+2){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+3){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(4n+4){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col[_ngcontent-%COMP%]:nth-child(n+5){width:25%;flex-grow:0}.quickKeys[_ngcontent-%COMP%] .quickKeyTabs[_ngcontent-%COMP%] div.row[_ngcontent-%COMP%] > div.col.active[_ngcontent-%COMP%]{color:#268ec1!important}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%]{padding:0}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]{margin-top:15px;margin-bottom:10px;word-break:break-all}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border:solid 1px #cfcfcf}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-align:center;display:block;cursor:pointer}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:80px;width:80px;display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #DDDDDD}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{height:80px;width:80px;font-size:20px;display:block;margin:0 auto;padding-top:22px;background-color:#a6a6a6;border:solid 1px #999999;border-top-left-radius:5px;border-bottom-right-radius:5px;color:#fff}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#000;font-size:11px;display:block;margin:5px 0 0}.quickKeys[_ngcontent-%COMP%] .tabItems[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] .ion-icon[_ngcontent-%COMP%]{font-size:75px;margin:10px}.quickKeys[_ngcontent-%COMP%] .variants-header[_ngcontent-%COMP%]{background:#ffffff;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#eeeeee",GradientType=0);color:#268ec1;cursor:pointer}.quickKeys[_ngcontent-%COMP%] .col-md-3.column.add[_ngcontent-%COMP%]{cursor:pointer}.quickKeys[_ngcontent-%COMP%] .col-md-3.column.add[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-top:10px}.quickKeys[_ngcontent-%COMP%] i.icon-col.fa.fa-xmark.text-danger[_ngcontent-%COMP%]{color:#fb404b!important;position:absolute;right:16px;top:5px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%]{background-color:#479ccf;padding:15px 25px;color:#fff;text-decoration:none;width:240px;display:block;opacity:.85;border-radius:5px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%]{position:absolute;top:120px;left:90px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%]:hover, .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%]:hover{opacity:.95}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%]{border-bottom:1px solid white;font-size:14px;margin:0 0 10px;padding:0 0 3px;display:block}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:inline-block;height:35px;margin:0 10px 0 0;font-size:28px}.quickKeys[_ngcontent-%COMP%] a#LinkConfigureQuickkey[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .quickKeys[_ngcontent-%COMP%] a#LinkConfigureParkLayout[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;font-size:14px;width:135px;vertical-align:top}.quickKeys[_ngcontent-%COMP%] .row.no-gutters.border.align-items-center.variants-header.cursor[_ngcontent-%COMP%]{background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%)}.general-information[_ngcontent-%COMP%] ol.mt-5.ml-5.pl-7[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{line-height:20px}.quickKeys[_ngcontent-%COMP%] {width:420px;position:relative}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-header-pagination{display:none!important}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-header{border-bottom:none}.quickKeys[_ngcontent-%COMP%] .mdc-tab-indicator{display:none!important}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels{border-bottom:0px;display:flex;flex-wrap:wrap}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab{height:44px;max-height:44px;overflow:hidden;padding:0!important;border-right:1px solid #cfcfcf;min-width:25%!important;flex-grow:1;flex-basis:0;font-size:14px;font-weight:700;outline:none;text-transform:uppercase;background:#ffffff;background:linear-gradient(to bottom,#ffffff 0%,#eeeeee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#eeeeee",GradientType=0);display:flex;white-space:normal!important}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab .mdc-tab__content{white-space:normal!important;align-self:center}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n){border-right:none}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:first-child{border-left:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(-n+4){border-right:1px solid #cfcfcf;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+1){border-left:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+2){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+3){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(4n+4){border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab:nth-child(n+5){width:25%;flex-grow:0}@media (max-width: 1092px){.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mat-mdc-tab{font-size:12px}}.quickKeys[_ngcontent-%COMP%] .mat-mdc-tab-labels .mdc-tab--active .mdc-tab__text-label{color:#268ec1!important;text-shadow:0px 0px 1px #268ec1!important}@media (max-width: 1210px){.quickKeys[_ngcontent-%COMP%]{width:340px}}']})),o})();var Mt=c(30273),Vn=c(15861),zn=c(39064),jn=c(30012),Wn=c(37646),Xn=c(74683),to=c(59810),eo=c(90764),no=c(84254),oo=c(89748),Dt=c(47130),St=c(82621),G=c(117),V=c(98448),Zt=c(33142);function io(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",10),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPark())}),t._uU(1),t.qZA()}if(2&o){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.AppConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkButtonLabel||"Park"," ")}}function ro(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",11),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.showRetrieveModal())}),t._uU(1," Retrieve "),t.qZA()}}function ao(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",12),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSplit())}),t._uU(1),t.qZA()}if(2&o){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.isSplit()?"Cancel":"Split"," ")}}function so(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"li",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPrintRetrieve())}),t._uU(1," Print "),t.qZA()}}function co(o,s){if(1&o&&(t.TgZ(0,"ul",5),t.YNc(1,io,2,1,"li",6),t.YNc(2,ro,2,0,"li",7),t.YNc(3,ao,2,1,"li",8),t.YNc(4,so,2,0,"li",9),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)&&(!e.IsEdit()||e.isRetrive())),t.xp6(1),t.Q6J("ngIf",e.role.Retrieve&&(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)),t.xp6(1),t.Q6J("ngIf",(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)&&(e.isRetrive()||e.isSplit())),t.xp6(1),t.Q6J("ngIf",(null==e.AppConfig?null:e.AppConfig.ApplicationParkAndRetrieve.Basic.EnableParkAndRetrieve)&&e.isRetrive())}}function lo(o,s){if(1&o&&t._UZ(0,"pos-receipt-a4",14),2&o){const e=t.oxw();t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)("outletInfo",e.outletInfo)}}function po(o,s){if(1&o&&t._UZ(0,"POS-bill-receipt-A4",14),2&o){const e=t.oxw();t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)("outletInfo",e.outletInfo)}}function uo(o,s){if(1&o&&t._UZ(0,"pos-receipt",15),2&o){const e=t.oxw();t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletInfo)}}function go(o,s){if(1&o&&t._UZ(0,"park-order",16),2&o){const e=t.oxw();t.Q6J("data",e.parkMini)("printTemplate",e.outletInfo.PrintTemplate)("config",e.AppConfig)}}let mo=(()=>{class o{constructor(e,n,r,a,l,m,f,C,y,O){(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_orderDataService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_receiptService",void 0),(0,i.Z)(this,"toastr",void 0),(0,i.Z)(this,"matDialog",void 0),(0,i.Z)(this,"_orderHttpService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_promotionEvent",void 0),(0,i.Z)(this,"AppConfig",new Y.A),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"orderProcessor",new zn.K),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"ParkLayoutPack",void 0),(0,i.Z)(this,"Payments",void 0),(0,i.Z)(this,"parkMini",void 0),(0,i.Z)(this,"outletInfo",void 0),(0,i.Z)(this,"park",void 0),(0,i.Z)(this,"parkOrderRetrieve",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"completeData",void 0),(0,i.Z)(this,"receiptTemplate",void 0),(0,i.Z)(this,"printMode",void 0),(0,i.Z)(this,"isPrintBIll",void 0),this._posService=e,this._orderProcessorService=n,this._orderDataService=r,this._outletService=a,this._receiptService=l,this.toastr=m,this.matDialog=f,this._orderHttpService=C,this._userRoleService=y,this._promotionEvent=O,this.printMode=2,this.destroy$=new v.x,this.subscribeToObservable(),this.Payments=this._posService.Data.Payments,this.AppConfig=this._posService.Data.AppConfigJSON}ngOnInit(){this.parkMini=null}subscribeToObservable(){this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.orderProcessor=e,this.checkPrintParkOrder()}),this._orderDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.outletInfo=e,this.ParkLayoutPack=e.ParkLayoutPack,this.park=new eo.f(this.ParkLayoutPack)}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e})}onPark(){if(this.AppConfig.ModuleSell.Header.CustomerRequired&&null==this.posData.Order.CustomerID)return void this.toastr.warning("Customer is needed before parking orders!","Missing customer!");if(u.gT.IsNotEmpty(this._promotionEvent.selectedPromotion)||u.gT.IsNotEmpty(this.posData.Order.AuthorizationKey))return void this.toastr.warning("sorry, you're using a promotion, can't use park!","can't use park when using promotions!");let n=!0;if(u.gT.IsEmpty(this.posData.Order.RegisterID)&&(this.toastr.warning(k.g.emptyEntity,z.n.Warning),n=!1),this.isSplit()){const r=this.posData.CartItems.filter(a=>a.Splited).length;!r&&this.posData.CartItems.length!=r&&(this.toastr.warning(k.g.emptyPOItem,z.n.Warning),n=!1)}if(0==this._orderDataService.Data.CartItems.length&&(this.toastr.warning("You must have at least one item","No Item in Cart!"),n=!1),n)if(this.ParkLayoutPack&&u.gT.IsNotEmpty(this.ParkLayoutPack.ID))this.isRetrive()&&!this.isSplit()?this.showReparkModal():this.showParkSelectModal();else{if(1==this.AppConfig.ApplicationParkAndRetrieve.Advance.retreiveMode)return void this.toastr.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!");const r=this.AppConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.DefaultParkNoteValue;!this.IsEdit()&&""!=r&&u.gT.IsEmpty(this.posData.Order.Note)&&(this.posData.Order.Note=r),this.showParkFormModal()}}showRetrieveModal(){this.ParkLayoutPack&&u.gT.IsEmpty(this.ParkLayoutPack.Layout)&&1==this.AppConfig.ApplicationParkAndRetrieve.Advance.retreiveMode?this.toastr.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!"):this.matDialog.open(to.Q).afterClosed().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.parkOrderRetrieve=e})}onSplit(){this._orderProcessorService.updatePosState(this.orderProcessor.posState==g.J.IsRetrieve?g.J.IsSplit:g.J.IsRetrieve)}IsEdit(){return this.orderProcessor.posState==g.J.IsEdit}isRetrive(){return this.orderProcessor.posState==g.J.IsRetrieve}isSplit(){return this.orderProcessor.posState==g.J.IsSplit}showReparkModal(){this.matDialog.open(jn.E,{data:this.parkOrderRetrieve})}showParkSelectModal(){this._orderHttpService.getVacant(this.posData.Order.EntityID).subscribe(e=>{this.matDialog.open(Wn.$,{data:{title:this.orderProcessor.posState==g.J.IsSplit?"Split Order":this.AppConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle,parkLayoutPack:this.ParkLayoutPack,qty:this.posData.TotalQuantity,entityId:this.posData.Order.EntityID,occupied:e.Orders,replaceWithAlias:this.AppConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias}})})}showParkFormModal(e){let n="PARK Details";e&&(n="# "+e),this.isSplit()&&(n="Split Detail"),this.matDialog.open(Xn.P,{id:"park-form-modal",data:{title:n,labelDisable:this.ParkLayoutPack&&u.gT.IsNotEmpty(this.ParkLayoutPack.ID)||this.orderProcessor.posState==g.J.IsSplit,ParkLabel:e||this.posData.Order.ParkLabel}})}checkPrintParkOrder(){this.orderProcessor.posState==g.J.isPark&&this.AppConfig.ApplicationParkAndRetrieve.PrintBehaviour.PrintAfterPark&&this.printPark(!0)}printPark(e){this.parkMini=this._receiptService.generateParkReceipt(e),this.printWindow().then(()=>{this.parkMini=null})}onPrintRetrieve(){this.AppConfig.ApplicationParkAndRetrieve.Basic.EnablePrintBill?this.matDialog.open(no.n).afterClosed().pipe((0,Ct.h)(n=>u.gT.IsNotEmpty(n))).subscribe(n=>{"ORDER"==n?this.printPark(!1):(this.isPrintBIll=!0,this.printBill())}):this.printPark(!1)}printBill(){let e;this.printMode=this.outletInfo.PrintTemplate.PrintMode,oo.LA.A4==this.printMode?(e=this._receiptService.generateBillInvoice(),this.receiptTemplate=e):(e=this._receiptService.generateBillReceipt(),this.receiptTemplate=e),this.printWindow().then(()=>{this.receiptTemplate=null,this.isPrintBIll=!1})}printWindow(){return(0,Vn.Z)(function*(){return new Promise(e=>{setTimeout(()=>{window.print(),e()},500)})})()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(x.W),t.Y36(M.d),t.Y36(S.q),t.Y36(P.o),t.Y36(Dt.V),t.Y36(U._W),t.Y36(h.uw),t.Y36(j.D),t.Y36(T.J),t.Y36(X.D))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-sidebutton"]],decls:6,vars:5,consts:[["class","park-action",4,"ngIf"],[1,"print_containers"],[3,"data","printTemplate","config","outletInfo",4,"ngIf"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo",4,"ngIf"],[3,"data","printTemplate","config",4,"ngIf"],[1,"park-action"],["id","btnPark","data-cy","btnPark","class","park",3,"click",4,"ngIf"],["class","retrieve","data-cy","btnRetreive",3,"click",4,"ngIf"],["class","split",3,"click",4,"ngIf"],["class","retrieve",3,"click",4,"ngIf"],["id","btnPark","data-cy","btnPark",1,"park",3,"click"],["data-cy","btnRetreive",1,"retrieve",3,"click"],[1,"split",3,"click"],[1,"retrieve",3,"click"],[3,"data","printTemplate","config","outletInfo"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo"],[3,"data","printTemplate","config"]],template:function(e,n){1&e&&(t.YNc(0,co,5,4,"ul",0),t.TgZ(1,"div",1),t.YNc(2,lo,1,4,"pos-receipt-a4",2),t.YNc(3,po,1,4,"POS-bill-receipt-A4",2),t.YNc(4,uo,1,5,"pos-receipt",3),t.YNc(5,go,1,3,"park-order",4),t.qZA()),2&e&&(t.Q6J("ngIf",n.AppConfig),t.xp6(2),t.Q6J("ngIf",n.receiptTemplate&&1==n.printMode&&!n.isPrintBIll),t.xp6(1),t.Q6J("ngIf",n.receiptTemplate&&1==n.printMode&&n.isPrintBIll),t.xp6(1),t.Q6J("ngIf",n.receiptTemplate&&2==n.printMode),t.xp6(1),t.Q6J("ngIf",n.parkMini))},dependencies:[p.O5,St.g,G.Y,V.t,Zt.Q],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.park-action[_ngcontent-%COMP%]{display:none}}.park-action[_ngcontent-%COMP%]{position:fixed;top:55%;transform:translateY(-50%);right:0}.park-action.fullscreen-button-right[_ngcontent-%COMP%]{right:0}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{width:68px;height:64px;cursor:pointer;outline:none;text-align:center;font-weight:700;font-family:Roboto Slab,serif;text-transform:uppercase;list-style:none;background-color:#89b03e;color:#fff;padding-top:23px;display:block}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(odd){border:1px solid #51632e}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(even){color:#545454;text-shadow:0 1px 0 white;background-color:#f4f4f4;font-weight:700;border-left:1px solid #a6a6a6;border-right:1px solid #a6a6a6}.park-action[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #a6a6a6}@media (max-width: 575.98px){.park-action[_ngcontent-%COMP%]{z-index:1000}}.park[_ngcontent-%COMP%] .mat-mdc-tab-body-content{overflow:hidden!important;padding-top:15px}"]})),o})();var Tt=c(51467),_o=c(34915),It=c(40083),fo=c(45882),kt=c(10812),ho=c(86725),Co=c(87019);const bo=function(){return["/Print/TaxInvoice"]},At=function(o){return{ID:o}};function vo(o,s){if(1&o&&(t.TgZ(0,"a",49),t._uU(1,"Tax"),t.qZA()),2&o){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,bo))("queryParams",t.VKq(3,At,e.completeData.ObjectID))}}const xo=function(o,s){return{ID:o,Template:s}};function Po(o,s){if(1&o&&(t.TgZ(0,"a",50),t._uU(1,"Delivery Order"),t.qZA()),2&o){const e=t.oxw();t.Q6J("queryParams",t.WLB(1,xo,e.completeData.OutDeliveryID,e.outletInfo.PrintTemplate.ID))}}const yo=function(o,s,e){return{InvoiceID:o,OutID:s,Template:e}};function Oo(o,s){if(1&o&&(t.TgZ(0,"a",51),t._uU(1,"Invoice & Delivery Order"),t.qZA()),2&o){const e=t.oxw();t.Q6J("queryParams",t.kEZ(1,yo,e.completeData.ObjectID,e.completeData.OutDeliveryID,e.outletInfo.PrintTemplate.ID))}}function Mo(o,s){if(1&o&&(t.TgZ(0,"a",52),t._uU(1,"Invoice (No Price)"),t.qZA()),2&o){const e=t.oxw();t.Q6J("href",e.getInvoicePrintURL(!0),t.LSH)}}const Do=function(o){return{ID:o,Print:1,Printer:"Normal"}};function So(o,s){if(1&o&&(t.TgZ(0,"a",53),t._uU(1,"Packing Slip"),t.qZA()),2&o){const e=t.oxw();t.Q6J("queryParams",t.VKq(1,Do,e.completeData.OutDeliveryID))}}function Zo(o,s){if(1&o&&(t.TgZ(0,"a",59),t._UZ(1,"i",60),t._uU(2,"Print Receipt "),t.qZA()),2&o){const e=t.oxw(3);t.Q6J("href",e.getInvoicePrintURL(!1),t.LSH)}}function To(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",61),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.print())}),t._UZ(1,"i",60),t._uU(2,"Print Receipt "),t.qZA()}}function Io(o,s){if(1&o&&(t.TgZ(0,"div",56),t.YNc(1,Zo,3,1,"a",57),t.YNc(2,To,3,0,"a",58),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.completeData),t.xp6(1),t.Q6J("ngIf",!e.completeData)}}function ko(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",56)(1,"button",62),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.generateLink())}),t._UZ(2,"i",63),t._uU(3,"Generate Payment Link "),t.qZA()()}}function Ao(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div",56)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.verifyPaymentSettlement())}),t._UZ(2,"i",65),t._uU(3,"Verify Payment Settlement "),t.qZA()()}}function wo(o,s){if(1&o&&(t.TgZ(0,"div",12)(1,"div",54),t.YNc(2,Io,3,2,"div",55),t.YNc(3,ko,4,0,"div",55),t.YNc(4,Ao,4,0,"div",55),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("ngIf",e.role.Reprint),t.xp6(1),t.Q6J("ngIf",1==e.completeData.PaymentStateID),t.xp6(1),t.Q6J("ngIf",e.isNotEmpty(e.paymentGatewayService.getTransactionId()))}}function No(o,s){if(1&o&&(t.ynx(0),t.TgZ(1,"a",66),t._uU(2),t.qZA(),t.BQk()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("queryParams",t.VKq(2,At,e.completeData.ObjectID)),t.xp6(1),t.hij(" Invoice #",null==e.completeData?null:e.completeData.InvoiceNumber," ")}}function Jo(o,s){if(1&o&&(t.TgZ(0,"span",67),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.hij(" Invoice #",null==e.completeData?null:e.completeData.InvoiceNumber," ")}}function Uo(o,s){if(1&o&&(t.TgZ(0,"div",2)(1,"div",69),t._uU(2),t.qZA(),t.TgZ(3,"div",70),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&o){const e=s.$implicit;t.xp6(2),t.Oqu(e.Label),t.xp6(2),t.AsE(" ",e.CurrencySymbol," ",t.lcZ(5,3,e.Amount)," ")}}function Qo(o,s){if(1&o&&(t.TgZ(0,"div",8),t.YNc(1,Uo,6,5,"div",68),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.itemSummary)}}function qo(o,s){if(1&o&&(t.TgZ(0,"div",74)(1,"div",75),t._uU(2),t.qZA(),t.TgZ(3,"div",76),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&o){const e=s.$implicit,n=s.index,r=t.oxw(2);t.xp6(1),t.Q6J("hidden",!r.role.PriceVisible),t.xp6(1),t.AsE(" ",e.Label,": ",e.CurrencySymbol," "),t.xp6(1),t.Q6J("hidden",!r.role.PriceVisible)("ngClass",n+1===r.amountSummary.length?"amount":""),t.xp6(1),t.hij(" ",t.lcZ(5,6,e.Amount)," ")}}function Ro(o,s){if(1&o&&(t.TgZ(0,"div",74)(1,"div",75),t._uU(2),t.qZA(),t.TgZ(3,"div",77),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&o){const e=s.$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("hidden",!n.role.PriceVisible),t.xp6(1),t.AsE(" ",e.Label,": ",e.CurrencySymbol," "),t.xp6(1),t.Q6J("hidden",!n.role.PriceVisible),t.xp6(1),t.hij(" ",t.lcZ(5,5,e.Amount)," ")}}function Eo(o,s){if(1&o&&(t.TgZ(0,"div",71),t.YNc(1,qo,6,8,"div",72),t.TgZ(2,"div",73),t.YNc(3,Ro,6,7,"div",72),t.qZA()()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.amountSummary),t.xp6(2),t.Q6J("ngForOf",e.paymentSummary)}}function Fo(o,s){if(1&o&&(t.TgZ(0,"div",78)(1,"div",79)(2,"p",80),t._uU(3," INVALID AMOUNT CHARGE, CORRECT AMOUNT "),t.qZA(),t.TgZ(4,"P",81),t._uU(5),t.ALo(6,"number"),t.qZA()()()),2&o){const e=t.oxw();t.xp6(5),t.Oqu(t.lcZ(6,1,e.completeData.Final))}}function Yo(o,s){if(1&o&&(t.TgZ(0,"div",82)(1,"div",40)(2,"h3",41),t._uU(3,"Point Balance"),t.qZA()(),t._UZ(4,"div",83),t.qZA()),2&o){const e=t.oxw();t.xp6(4),t.Q6J("innerHtml",e.completeData.LoyaltyPoint,t.oJD)}}function Ho(o,s){if(1&o&&t._UZ(0,"pos-receipt",87),2&o){const e=t.oxw(2);t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.posStorage.AppConfigJSON)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletInfo)}}function Ko(o,s){if(1&o&&t._UZ(0,"pos-receipt-a4",88),2&o){const e=t.oxw(2);t.Q6J("data",e.receiptTemplate)("printTemplate",e.outletInfo.PrintTemplate)("config",e.posStorage.AppConfigJSON)("workOrderMode",!1)("outletInfo",e.outletInfo)}}function Lo(o,s){if(1&o&&(t.TgZ(0,"div",84),t.YNc(1,Ho,1,5,"pos-receipt",85),t.YNc(2,Ko,1,5,"pos-receipt-a4",86),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.receiptTemplate&&2==e.printMode),t.xp6(1),t.Q6J("ngIf",e.receiptTemplate&&1==e.printMode)}}const Bo=function(o){return{"bg-gradient-warning":o}};let $o=(()=>{class o{handleF8(){this.newSale()}get posStorage(){return this._posService.Data}constructor(e,n,r,a,l,m,f,C,y,O,q,R,rt,at,st,Ci,bi,vi,xi,Pi,yi){(0,i.Z)(this,"_posDataService",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_OrderHttpService",void 0),(0,i.Z)(this,"_PaymentHttpService",void 0),(0,i.Z)(this,"_receiptService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_toastr",void 0),(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_matDialog",void 0),(0,i.Z)(this,"ref",void 0),(0,i.Z)(this,"_signalBroadCast",void 0),(0,i.Z)(this,"_calculatorService",void 0),(0,i.Z)(this,"_localDataService",void 0),(0,i.Z)(this,"_userRoleService",void 0),(0,i.Z)(this,"_router",void 0),(0,i.Z)(this,"_receiptCalculatorService",void 0),(0,i.Z)(this,"datePipe",void 0),(0,i.Z)(this,"decimalPipe",void 0),(0,i.Z)(this,"paymentGatewayService",void 0),(0,i.Z)(this,"paymentHttpService",void 0),(0,i.Z)(this,"posData",new F.m),(0,i.Z)(this,"receiptTemplate",null),(0,i.Z)(this,"completeData",new _o.u),(0,i.Z)(this,"printMode",2),(0,i.Z)(this,"outletInfo",new _t.t),(0,i.Z)(this,"role",void 0),(0,i.Z)(this,"email",""),(0,i.Z)(this,"editAfterDelivery",!1),(0,i.Z)(this,"finalAmountDifferent",!1),(0,i.Z)(this,"amountSummary",[]),(0,i.Z)(this,"itemSummary",[]),(0,i.Z)(this,"paymentSummary",[]),(0,i.Z)(this,"orderManager",void 0),(0,i.Z)(this,"isOnline",!1),(0,i.Z)(this,"destroy$",new v.x),(0,i.Z)(this,"posState",void 0),(0,i.Z)(this,"isOrderDateNow",void 0),this._posDataService=e,this._posService=n,this._orderProcessorService=r,this._OrderHttpService=a,this._PaymentHttpService=l,this._receiptService=m,this._outletService=f,this._toastr=C,this._onlineStatusService=y,this._matDialog=O,this.ref=q,this._signalBroadCast=R,this._calculatorService=rt,this._localDataService=at,this._userRoleService=st,this._router=Ci,this._receiptCalculatorService=bi,this.datePipe=vi,this.decimalPipe=xi,this.paymentGatewayService=Pi,this.paymentHttpService=yi}ngOnInit(){this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._posDataService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.posData=e}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.outletInfo=e}),this._OrderHttpService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(()=>{this.itemSummary=this._receiptService.generateCartItemSummary(),this.amountSummary=this._receiptCalculatorService.generateAmountSummary(),this.paymentSummary=this._receiptService.generatePaymentSummary()}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.orderManager=e,this.posState=e.posState,this._OrderHttpService.Data&&(this.completeData=this._OrderHttpService.Data),this.checkOrderDateIsNow(),this.checkFinalAmountDifferent()}),this._onlineStatusService.getOnlineStatus$().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.isOnline=e}),this._userRoleService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.role=e}),this._router.events.pipe((0,d.R)(this.destroy$)).subscribe(e=>{e instanceof b.OD&&(this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(g.J.IsNew))})}ngAfterViewInit(){this.posState==g.J.IsComplete&&(this.checkOrderNumber(),""==this.email&&null!=this.completeData.Contact&&this.isNotEmpty(this.completeData.Contact.Email)&&(this.email=this.completeData.Contact.Email),this.isOnline||this._toastr.warning(k.g.submitLocally,"Info!"),this.printMode=this.outletInfo.PrintTemplate.PrintMode,this.print(),this.ref.detectChanges())}checkOrderDateIsNow(){let e=this.completeData.OrderTimeString,n=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy");this.isOrderDateNow=e.includes(n)}checkFinalAmountDifferent(){if(this.posState==g.J.IsComplete){const n=this.completeData.Final;if(n-this._calculatorService.Data>this.posStorage.AppConfigJSON.ModuleSell.ToleranceAmount){this.finalAmountDifferent=!0;const m=this.decimalPipe.transform(n);setTimeout(()=>{this._toastr.warning(`Final Amount should be ${m}! Use Print Receipt to print the correct Receipt!`,"Invalid Amount charged",{timeOut:1e4})},500)}else this.finalAmountDifferent=!1}}checkOrderNumber(){this.completeData.InvoiceNumber!=this.posData.Order.Number&&(this._toastr.warning("Your invoice number is changed to "+this.completeData.InvoiceNumber,"Invoice Number Changed!"),this.posData.Order.Number=this.completeData.InvoiceNumber)}generateLink(){1==this.posStorage.AppConfigJSON.PaymentConfigLink&&this._matDialog.open(It.z),this._PaymentHttpService.generateLink({InvoiceID:this.completeData.ObjectID}).subscribe({next:n=>{this._matDialog.open(It.z,{data:{link:n.token.redirect_url}})},error:n=>{this._toastr.error(n.Message,"Couldn't generate link!")}})}newSale(){try{this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(g.J.IsNew),this._router.navigate([],{queryParams:{ID:null}})}catch(e){console.error(e),this._toastr.error(e,"Error redirecting to NEW mode")}}shelve(){const e=this._OrderHttpService.generatePOSDataForSubmission(this.posData);this._localDataService.syncOrder(e).subscribe(()=>{this.newSale()})}retrySubmit(){this._posDataService.pushNewValue(this.posData),this._posDataService.submitOrder(this.posStorage.AppConfigJSON).then(e=>{e.Success?(this._signalBroadCast.BroadcastStateToCustomerDisplay(g.J.IsComplete,e.ObjectID,e.LoyaltyPoint,this.posData.TotalPaidAmount-this._calculatorService.Data),this._posDataService.pushNewValue(this.posData),this._orderProcessorService.updatePosState(g.J.IsComplete,e)):(this._posDataService.pushNewValue(this.posData),this._orderProcessorService.updatePosState(g.J.IsComplete,e))})}getInvoicePrintURL(e){let r="";return e&&(r="&Print=1&Price=0"),u.gT.StringFormat("{0}?ID={1}&Template={2}{3}","/print/Invoice"+(2===this.outletInfo.PrintTemplate.PrintMode?"Mini":""),this.completeData.ObjectID,this.outletInfo.PrintTemplate.ID,r)}sendEmail(){null!=this.email&&0!=this.email.length||(this.email=document.getElementById("contactEmail").value,""!=this.email)?this._OrderHttpService.sendEmail(this.email,this.completeData.ObjectID).then(e=>{this._toastr.success(e.Message,"Email sent!")}):this._toastr.error("Please enter email before sending receipt!","No email")}print(){this.isOnline||(this.printMode=2,this._toastr.info("Could not print in A4 format due to network connectivity","Can't Print A4 Format!")),2==this.printMode?this.printReceiptMini():1==this.printMode&&this.printReceiptA4(),this.posStorage.AppConfigJSON.ModuleSell.Printing.PrintOnPayment&&this.printWindow()}printReceiptMini(){this.receiptTemplate=this._receiptService.generateReceiptMini()}printReceiptA4(){this._OrderHttpService.generateReceiptA4(this.completeData.ObjectID).subscribe({next:e=>{this.receiptTemplate=e.Data},error:e=>{this._toastr.error("Could not print in A4 format!\nPrinting in 8mm format instead!","Error!"),this.printReceiptMini()}})}printWindow(){this.finalAmountDifferent||setTimeout(()=>{window.print()},700)}isNotEmpty(e){return u.gT.IsNotEmpty(e)}updateEmail(e){this.email=e}verifyPaymentSettlement(){let e=new fo.r;e.Amount=this.completeData.Final,e.TransactionID=this.paymentGatewayService.getTransactionId(),e.RegisterID=this._outletService.Data.RegisterID,e.Number=this.posData.Order.Number,this.paymentHttpService.VerifyPayment(e).pipe((0,d.R)(this.destroy$)).subscribe({next:n=>{this._toastr.success(n.Message,"QR Settlement")}})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(S.q),t.Y36(x.W),t.Y36(M.d),t.Y36(j.D),t.Y36(kt.q),t.Y36(Dt.V),t.Y36(P.o),t.Y36(U._W),t.Y36(J.q),t.Y36(h.uw),t.Y36(t.sBO),t.Y36(ho.j),t.Y36(H.J),t.Y36(W.T),t.Y36(T.J),t.Y36(b.F0),t.Y36(Co.i),t.Y36(p.uU),t.Y36(p.JJ),t.Y36(ct.i),t.Y36(kt.q))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos-complete"]],hostBindings:function(e,n){1&e&&t.NdJ("keydown.F8",function(a){return n.handleF8(a)},!1,t.Jf7)},decls:65,vars:21,consts:[[1,"sell-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-md-8"],[1,"card",3,"hidden"],[1,"card-header","alert-danger"],[1,"d-flex","justify-content-between"],[1,"fa-solid","fa-xmark-circle","me-1","text-danger"],[1,"card-body"],[1,"row","mt-9","justify-content-center","g-0","mb-9"],[1,"col-5","text-center"],["type","button","matTooltipPosition","above","matTooltip","Try uploading order to the server again",1,"btn","btn-success","btn-lg",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-floppy-disk","me-2",2,"font-size","14px"],[1,"card-header",3,"ngClass"],[1,"fa-solid","fa-check","me-1"],[1,"fst-italic"],[1,"dropdown"],["type","button","id","dropdownMenuButton","data-bs-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","dropdown-toggle"],["aria-labelledby","dropdownMenuButton",1,"dropdown-menu","dropdown-menu-end"],["class","dropdown-item","target","_blank",3,"routerLink","queryParams",4,"ngIf"],["class","dropdown-item","routerLink","/print/OutDelivery","target","_blank",3,"queryParams",4,"ngIf"],["class","dropdown-item","routerLink","/print/InvoiceNOutD","target","_blank",3,"queryParams",4,"ngIf"],["class","dropdown-item","target","_blank",3,"href",4,"ngIf"],["class","dropdown-item","routerLink","/print/PackingSlip","target","_blank",3,"queryParams",4,"ngIf"],[1,"container"],[1,"row","border-bottom","align-items-center","g-0","mt-5"],[1,"col-auto","px-2"],[1,"fa-solid","fa-envelope","fa-lg"],[1,"col"],["placeholder","Email Receipt","inputID","contactEmail","requestUrl","/API/AC/GetEmailSuggestion",1,"border-0","w-100",3,"inputTextValue","onSelect"],[1,"col-auto","pe1"],["type","button",1,"btn","btn-light-gray",3,"click"],[1,"col-10","text-center"],["type","button",1,"btn","btn-success","btn-lg","w-100",3,"click"],["class","card-footer bg-light-gray",4,"ngIf"],[1,"col-md-4"],[1,"card-header","bg-light-gray"],[1,"text-dark"],[4,"ngIf","ngIfElse"],["OFFLINE",""],["class","card-body",4,"ngIf"],["class","card-footer bg-white",4,"ngIf"],["class","card-footer bg-gradient-warning",4,"ngIf"],["class","card",4,"ngIf"],["class","print_containers",4,"ngIf"],["target","_blank",1,"dropdown-item",3,"routerLink","queryParams"],["routerLink","/print/OutDelivery","target","_blank",1,"dropdown-item",3,"queryParams"],["routerLink","/print/InvoiceNOutD","target","_blank",1,"dropdown-item",3,"queryParams"],["target","_blank",1,"dropdown-item",3,"href"],["routerLink","/print/PackingSlip","target","_blank",1,"dropdown-item",3,"queryParams"],[1,"row","justify-content-between"],["class","col-auto my-6",4,"ngIf"],[1,"col-auto","my-6"],["target","_blank","class","btn btn-light-gray",3,"href",4,"ngIf"],["class","btn btn-light-gray",3,"click",4,"ngIf"],["target","_blank",1,"btn","btn-light-gray",3,"href"],[1,"fa-solid","fa-print","me-2"],[1,"btn","btn-light-gray",3,"click"],["type","button","data-cy","payment-link",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-money-bill-wave","me-2"],["type","button","data-cy","verify-payment-settelment",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-circle-check","me-2"],["target","_blank","routerLink","/menu/Orders/Orders/Customer_Invoice/Info",1,"text-dark","fst-italic",3,"queryParams"],[1,"text-dark","fst-italic"],["class","row",4,"ngFor","ngForOf"],[1,"col-8"],[1,"col-4","text-end"],[1,"card-footer","bg-white"],["class","d-flex justify-content-end","style","line-height: 30px;",4,"ngFor","ngForOf"],[1,"border-top"],[1,"d-flex","justify-content-end",2,"line-height","30px"],[1,"text-end",3,"hidden"],[1,"text-end","w-50",3,"hidden","ngClass"],[1,"text-end","w-50",3,"hidden"],[1,"card-footer","bg-gradient-warning"],[1,"text-end"],[1,"fw-bold"],[1,"text-danger",2,"font-size","38px"],[1,"card"],[1,"card-body","pb-0","text-center",3,"innerHtml"],[1,"print_containers"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo",4,"ngIf"],[3,"data","printTemplate","config","workOrderMode","outletInfo",4,"ngIf"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo"],[3,"data","printTemplate","config","workOrderMode","outletInfo"]],template:function(e,n){if(1&e&&(t.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"h2"),t._UZ(8,"i",7),t._uU(9," Order Upload Fail! "),t.qZA()()(),t.TgZ(10,"div",8)(11,"div",9)(12,"div",10)(13,"button",11),t.NdJ("click",function(){return n.retrySubmit()}),t._uU(14," Retry Upload "),t.qZA()()()(),t.TgZ(15,"div",12)(16,"div",13)(17,"div",14)(18,"button",15),t.NdJ("click",function(){return n.shelve()}),t._UZ(19,"i",16),t._uU(20,"Save Offline "),t.qZA()()()()(),t.TgZ(21,"div",4)(22,"div",17)(23,"div",6)(24,"h2"),t._UZ(25,"i",18),t._uU(26," Sell Complete "),t.TgZ(27,"small",19),t._uU(28),t.qZA()(),t.TgZ(29,"div")(30,"div",20),t._UZ(31,"button",21),t.TgZ(32,"div",22),t.YNc(33,vo,2,5,"a",23),t.YNc(34,Po,2,4,"a",24),t.YNc(35,Oo,2,5,"a",25),t.YNc(36,Mo,2,1,"a",26),t.YNc(37,So,2,3,"a",27),t.qZA()()()()(),t.TgZ(38,"div",8)(39,"div",28)(40,"div",29)(41,"div",30),t._UZ(42,"i",31),t.qZA(),t.TgZ(43,"div",32)(44,"autocompleteV2",33),t.NdJ("onSelect",function(a){return n.updateEmail(a)}),t.qZA()(),t.TgZ(45,"div",34)(46,"a",35),t.NdJ("click",function(){return n.sendEmail()}),t._uU(47,"Send Receipt"),t.qZA()()(),t.TgZ(48,"div",9)(49,"div",36)(50,"button",37),t.NdJ("click",function(){return n.newSale()}),t._uU(51," New Sale (F8) "),t.qZA()()()()(),t.YNc(52,wo,5,3,"div",38),t.qZA()(),t.TgZ(53,"div",39)(54,"div",4)(55,"div",40)(56,"h3",41),t.YNc(57,No,3,4,"ng-container",42),t.YNc(58,Jo,2,1,"ng-template",null,43,t.W1O),t.qZA()(),t.YNc(60,Qo,2,1,"div",44),t.YNc(61,Eo,4,2,"div",45),t.YNc(62,Fo,7,3,"div",46),t.qZA(),t.YNc(63,Yo,5,1,"div",47),t.qZA()()()(),t.YNc(64,Lo,3,2,"div",48)),2&e){const r=t.MAs(59);t.xp6(4),t.Q6J("hidden",1==n.posState),t.xp6(17),t.Q6J("hidden",9==n.posState),t.xp6(1),t.Q6J("ngClass",t.VKq(19,Bo,!n.isOrderDateNow||n.completeData.PaymentStateID<3)),t.xp6(6),t.hij(" (",n.completeData.PaymentStateLabel,")"),t.xp6(5),t.Q6J("ngIf",n.completeData),t.xp6(1),t.Q6J("ngIf",n.completeData.OutDeliveryID),t.xp6(1),t.Q6J("ngIf",n.completeData.OutDeliveryID),t.xp6(1),t.Q6J("ngIf",n.completeData),t.xp6(1),t.Q6J("ngIf",n.completeData.OutDeliveryID),t.xp6(7),t.Q6J("inputTextValue",n.email),t.xp6(8),t.Q6J("ngIf",n.isOnline&&(n.role.Reprint||1==n.completeData.PaymentStateID||n.isNotEmpty(n.paymentGatewayService.getTransactionId()))),t.xp6(2),t.Q6J("hidden",9==n.posState),t.xp6(3),t.Q6J("ngIf",n.isOnline)("ngIfElse",r),t.xp6(3),t.Q6J("ngIf",n.itemSummary),t.xp6(1),t.Q6J("ngIf",!n.finalAmountDifferent),t.xp6(1),t.Q6J("ngIf",n.finalAmountDifferent),t.xp6(1),t.Q6J("ngIf",n.completeData.LoyaltyPoint),t.xp6(1),t.Q6J("ngIf",n.outletInfo)}},dependencies:[p.mk,p.sg,p.O5,b.rH,A.J,V.t,G.Y,p.JJ],styles:[".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,#f5c6cb 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#28a745,#28a745 15px,#a2dbb0 15px,#a2dbb0 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#FCF3CF,#FCF3CF 15px,#F9E79F 15px,#F9E79F 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}.print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.sell-complete[_ngcontent-%COMP%]{display:none}}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container{max-width:500px;margin-top:30px;margin-bottom:30px}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] mat-form-field input.form-control{border:none;font-size:16px;padding-left:2px}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] mat-form-field input.form-control:focus{border:none}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] [type=button]{-webkit-appearance:initial}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] input{font-size:1rem}.sell-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .btn-success{padding:.5rem 1rem;font-size:1.25rem}.sell-complete[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-size:16px}"]})),o})();function Go(o,s){if(1&o&&t._UZ(0,"pos-header",4),2&o){const e=t.oxw();t.Q6J("isOnline",e.isOnline)}}function Vo(o,s){1&o&&t._UZ(0,"pos-sidebutton")}function zo(o,s){if(1&o&&(t.ynx(0),t._UZ(1,"pos-toolbar"),t.TgZ(2,"div",8)(3,"div",9),t._UZ(4,"pos-quick-key"),t.qZA(),t.TgZ(5,"div",10),t._UZ(6,"pos-cart"),t.qZA()(),t.YNc(7,Vo,1,0,"pos-sidebutton",11),t.BQk()),2&o){const e=t.oxw(2);t.xp6(7),t.Q6J("ngIf",e.isOnline)}}function jo(o,s){1&o&&(t.TgZ(0,"div"),t._UZ(1,"pos-complete"),t.qZA())}function Wo(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"div")(1,"h4",12),t._UZ(2,"i",13),t.TgZ(3,"span",14),t._uU(4,"Commission for order"),t.qZA(),t.TgZ(5,"a",15)(6,"small",16),t._uU(7),t.qZA()()(),t.TgZ(8,"commission-cart",17),t.NdJ("onSaved",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onCommissionSaved())})("onBack",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.orderManager.CommissionID=null)}),t.qZA()()}if(2&o){const e=t.oxw(3);t.xp6(7),t.hij("#",null==e.submitOrderData?null:e.submitOrderData.InvoiceNumber,""),t.xp6(1),t.Q6J("soid",e.orderManager.CommissionID)("listSales",e.outletInfo.ListSales)}}function Xo(o,s){if(1&o&&(t.YNc(0,jo,2,0,"div",11),t.YNc(1,Wo,9,3,"div",11)),2&o){const e=t.oxw(2);t.Q6J("ngIf",!e.orderManager.CommissionID),t.xp6(1),t.Q6J("ngIf",e.orderManager.CommissionID)}}function ti(o,s){if(1&o&&(t.TgZ(0,"div",5),t.YNc(1,zo,8,1,"ng-container",6),t.YNc(2,Xo,2,2,"ng-template",null,7,t.W1O),t.qZA()),2&o){const e=t.MAs(3),n=t.oxw();t.xp6(1),t.Q6J("ngIf",n.IsNotCompleteOrFailed())("ngIfElse",e)}}let ei=(()=>{class o extends Et.M{constructor(e,n,r,a,l,m,f,C,y,O,q,R,rt,at,st){super(r),(0,i.Z)(this,"dialogRef",void 0),(0,i.Z)(this,"_posService",void 0),(0,i.Z)(this,"_httpService",void 0),(0,i.Z)(this,"_OrderHttpService",void 0),(0,i.Z)(this,"_orderProcessorService",void 0),(0,i.Z)(this,"_outletService",void 0),(0,i.Z)(this,"_onlineStatusService",void 0),(0,i.Z)(this,"_route",void 0),(0,i.Z)(this,"_signalRClientService",void 0),(0,i.Z)(this,"_toastr",void 0),(0,i.Z)(this,"_paymentServiceGateway",void 0),(0,i.Z)(this,"_numpadService",void 0),(0,i.Z)(this,"userRoleService",void 0),(0,i.Z)(this,"roleService",void 0),(0,i.Z)(this,"posHttpResponse",void 0),(0,i.Z)(this,"isOnline",!0),(0,i.Z)(this,"posState",void 0),(0,i.Z)(this,"commissionID",void 0),(0,i.Z)(this,"outletInfo",void 0),(0,i.Z)(this,"orderManager",void 0),(0,i.Z)(this,"submitOrderData",void 0),(0,i.Z)(this,"destroy$",void 0),(0,i.Z)(this,"decimalPipe",void 0),(0,i.Z)(this,"invoiceNumberEdit",void 0),this.dialogRef=e,this._posService=n,this._httpService=r,this._OrderHttpService=a,this._orderProcessorService=l,this._outletService=m,this._onlineStatusService=f,this._route=C,this._signalRClientService=y,this._toastr=O,this._paymentServiceGateway=q,this._numpadService=R,this.userRoleService=rt,this.roleService=at,this.destroy$=new v.x,this.decimalPipe=new p.JJ(st)}ngOnInit(){this.menuData$.pipe((0,d.R)(this.destroy$)).subscribe(()=>{this._posService.request().then(e=>{if(this.posHttpResponse=e,this.subscribeToObservableChanges(),this.checkClientTime(),this._route.snapshot.queryParamMap.has("ID")){const n=this._route.snapshot.queryParamMap.get("ID");this.editInvoice(n)}else this._outletService.setActiveRegisterFromOptions(e.Registers,e.UserName);this.initializeRole()})})}initializeRole(){const e=new Ft.Q(this.roleService);this.userRoleService.pushNewValue(e)}onQRPaymentComplete(e){if(!u.gT.IsEmpty(e)){const n=JSON.parse(e);this._paymentServiceGateway.onQRPaymentComplete(n,this.posHttpResponse.AppConfigJSON).then(r=>{this.dialogRef.getDialogById("ModalPayment").close();const m=`IDR ${this.decimalPipe.transform(n.gross_amount)} received. Please verify in customer mobile app!`;this._toastr.success(m," QR Settlement"),this._orderProcessorService.updatePosState(g.J.IsComplete,r)}).catch(r=>{this._toastr.error(r.message,r.header?r.header:"Error")})}}editInvoice(e){this._orderProcessorService.updatePosState(g.J.IsEdit),this._OrderHttpService.GetInvoiceBySoID(e).pipe((0,d.R)(this.destroy$)).subscribe(n=>{this.invoiceNumberEdit=n.Invoice.Number,n.Invoice.Number=null,this._orderProcessorService.plainToClass(n),this.syncPageHeaderLabel(g.J.IsEdit)})}subscribeToObservableChanges(){this._onlineStatusService.getOnlineStatus$().pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.isOnline=e}),this._orderProcessorService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.orderManager=e,this.submitOrderData=this._OrderHttpService.Data,this.posState=e.posState,this.syncPageHeaderLabel(this.posState)}),this._outletService.Data$.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.outletInfo=e}),this._signalRClientService.OnPaymentReceived.pipe((0,d.R)(this.destroy$)).subscribe(e=>{this.onQRPaymentComplete(e)})}IsNotCompleteOrFailed(){let e;switch(this.posState){case g.J.IsComplete:case g.J.UploadOrderFail:e=!1;break;default:e=!0}return e}syncPageHeaderLabel(e){switch(e){case g.J.IsEdit:this.invoiceNumberEdit&&(this.menuData.H=`Editing Order#${this.invoiceNumberEdit}`);break;case g.J.IsComplete:this.menuData.H=u.gT.IsEmpty(this.orderManager.CommissionID)?"Order Complete":"New Sale Order";break;default:this.menuData.H="New Sale Order"}}onCommissionSaved(){this.orderManager.CommissionID=null}checkClientTime(){let e=new Date(this.posHttpResponse.ServerDateString),n=new Date;e.getDate()!==n.getDate()&&this._toastr.warning("Client date is not equal with Server Date",z.n.Warning)}ngOnDestroy(){this._numpadService.destroy(),this.destroy$.next(!0),this.destroy$.complete()}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)(t.Y36(h.uw),t.Y36(x.W),t.Y36(Yt.O),t.Y36(j.D),t.Y36(M.d),t.Y36(P.o),t.Y36(J.q),t.Y36(b.gz),t.Y36(Ht.G),t.Y36(U._W),t.Y36(ct.i),t.Y36(Kt.u),t.Y36(T.J),t.Y36(Lt.N),t.Y36(t.soG))}),(0,i.Z)(o,"\u0275cmp",t.Xpm({type:o,selectors:[["pos"]],features:[t.qOj],decls:6,vars:7,consts:[["rel","stylesheet","href","/Styles/Master/app_custom.css"],[3,"hideSearchDropdown","hideSearchBox","offline","pageData","hideMoreMenu"],[3,"isOnline",4,"ngIf"],["class","container-fluid",4,"ngIf"],[3,"isOnline"],[1,"container-fluid"],[4,"ngIf","ngIfElse"],["complete",""],[1,"row","row","body","g-0","mt-4","justify-content-start"],[1,"col-auto","quickKey"],[1,"col-auto","cart"],[4,"ngIf"],[1,"text-link","my-8"],["aria-hidden","true",1,"fa-solid","fa-arrows-rotate"],[1,"text-primary","fw-bold","h4"],[1,"text-dark","fs-10","fst-italic"],[1,"text-muted"],[3,"soid","listSales","onSaved","onBack"]],template:function(e,n){1&e&&(t._UZ(0,"link",0),t.TgZ(1,"mainpanel-cmp",1)(2,"actions"),t.YNc(3,Go,1,1,"pos-header",2),t.qZA(),t.TgZ(4,"content"),t.YNc(5,ti,4,2,"div",3),t.qZA()()),2&e&&(t.xp6(1),t.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("offline",!n.isOnline)("pageData",n.menuData)("hideMoreMenu",1==n.posState),t.xp6(2),t.Q6J("ngIf",n.posHttpResponse&&n.IsNotCompleteOrFailed()),t.xp6(2),t.Q6J("ngIf",n.posHttpResponse))},dependencies:[p.O5,pe,Je,Nn,Gn,Mt.p,mo,Tt.W,$o],styles:['@media print{.cashier[_ngcontent-%COMP%], pos-quick-key[_ngcontent-%COMP%], pos-header[_ngcontent-%COMP%], pos-toolbar[_ngcontent-%COMP%]{display:none}}.quickKey[_ngcontent-%COMP%]{margin-right:10px}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-webkit-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]::-moz-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] [_ngcontent-%COMP%]:-ms-input-placeholder{font-style:italic}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.quickKey[_ngcontent-%COMP%]{width:420px;margin-right:10px}.cashier[_ngcontent-%COMP%] div.container-fluid[_ngcontent-%COMP%] div.row.body[_ngcontent-%COMP%] div.cart[_ngcontent-%COMP%]{width:570px}@media only screen and (max-width: 1280px){input[id=ContactID][_ngcontent-%COMP%]{width:135px}}@media only screen and (max-width: 1215px){input[id=ContactID][_ngcontent-%COMP%]{width:120px}}@media only screen and (max-width: 1185px){input[id=ContactID][_ngcontent-%COMP%]{width:140px}} .hg-theme-default .hg-button{height:70px!important;font-size:16px!important} .hg-button-bksp{width:21px} .hg-button[data-skbtn="{enter}"][_ngcontent-%COMP%]{width:90px}']})),o})();var wt=c(35510);const ni=[{path:"",component:ei},{path:"V3",component:wt.SellV3Component},{path:"**",redirectTo:"",pathMatch:"full"}];let oi=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[b.Bz.forChild(ni),b.Bz]})),o})();var Nt=c(71948),Jt=c(90811),ii=c(4859);let ri=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[p.ez,I.d,Nt.Fk,_.u5,N.Nh,Z.dr,Jt.vV,oe,D.AV,ii.ot]})),o})();var it=c(65131),Ut=c(94673);let ai=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[p.ez,et.ZU,Z.dr,_.u5,I.d,$.A0,it.X,A.Q,nt.q,D.AV,Ut.z,Nt.Fk]})),o})(),Qt=(()=>{class o{transform(e,n,...r){return e.filter(a=>!n.includes(a.ID))}}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275pipe",t.Yjl({name:"payment",type:o,pure:!0})),o})();var si=c(14650),ci=c(12386),li=c(70585),di=c(54825),pi=c(945),ui=c(78639),gi=c(5536);let mi=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({providers:[Qt],imports:[p.ez,$.A0,w.Tx,_.u5,I.d,et.ZU,N.Nh,Z.dr,B._t,it.X,si.r,ci.S,A.Q,Jt.vV,li._8,b.Bz,nt.q,ot.JX,di.O,Ut.z,D.AV,pi.M,ui.g,gi.E]})),o})(),_i=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({imports:[p.ez,b.Bz,_.u5,$.A0,N.Nh,I.d,Z.dr,St.I,G.o,V.e,it.X,Zt.y]})),o})(),qt=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({providers:[yt],imports:[p.ez,N.Nh,Z.dr,b.Bz]})),o})();var fi=c(64425);let hi=(()=>{class o{}return(0,i.Z)(o,"\u0275fac",function(e){return new(e||o)}),(0,i.Z)(o,"\u0275mod",t.oAB({type:o})),(0,i.Z)(o,"\u0275inj",t.cJS({providers:[Qt],imports:[p.ez,_.u5,_.UX,oi,ri,ai,mi,qt,Mt.R,qt,Z.dr,A.Q,V.e,G.o,_i,Tt.$,I.d,fi.Iq,wt.SellV3Component]})),o})()}}]);