import{a as N}from"./chunk-4KDVZQWM.js";import{a as j}from"./chunk-4KBZKTAT.js";import{a as C}from"./chunk-W3T7TSU6.js";import{a as w,f as L}from"./chunk-Z5PP2CRF.js";import"./chunk-MANB3PJC.js";import"./chunk-A4FSGNM7.js";import{Bd as G,ad as A,bd as D,ca as r,md as n,uc as v}from"./chunk-CBXQYRPM.js";import{Bc as O,Ka as p,Kb as h,La as a,Lb as u,Rc as F,Sc as R,Tc as k,Yc as y,Z as M,Zb as S,Zc as T,_b as d,da as s,k as E,ka as I,la as m,mb as o,nb as l,ob as g,vb as _}from"./chunk-LVXYIJUI.js";var P=(()=>{class e{constructor(t,i,c,f,U){this.router=t,this.translateService=i,this.toastMessageService=c,this.checkpointScanFrameService=f,this.checkpointScanItemsFacade=U,this.destroySubject=new E}ngOnInit(){this.scannedUniqueItem=this.checkpointScanFrameService.getCheckpointScannedItem()}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}actionReturnToStock(){this.checkpointScanItemsFacade.returnToStock(this.scannedUniqueItem.uniqueItemID).pipe(M(this.destroySubject)).subscribe(t=>{t.flagAlreadyAttached?(this.checkpointScanFrameService.clearScan(),this.toastMessageService.showToastPanel(n.getWarningDefaultConfig().withMessage(this.translateService.instant("MSG_ITEM_FLAG_ALREADY_RETURN_TO_STOCK")))):t.flagID>0?(this.checkpointScanFrameService.clearScan(),this.toastMessageService.showToastPanel(n.getSuccessDefaultConfig().withMessage(this.translateService.instant("MSG_ITEM_FLAG_RETURN_TO_STOCK")))):this.toastMessageService.showToastPanel(n.getErrorDefaultConfig().withMessage(this.translateService.instant("MSG_NO_FLAG_ATTACHED_FOR_EVENT"))),this.router.navigate([r.MainPanel.path,r.Dialogs.CheckpointScan.path,C.Scan.path]).catch(v.EMPTY_REJECTION_HANDLER)})}actionRag(){this.checkpointScanItemsFacade.rag(this.scannedUniqueItem.uniqueItemID).pipe(M(this.destroySubject)).subscribe(t=>{t.flagAlreadyAttached?(this.checkpointScanFrameService.clearScan(),this.toastMessageService.showToastPanel(n.getWarningDefaultConfig().withMessage(this.translateService.instant("MSG_ITEM_FLAG_ALREADY_RAG")))):t.flagID>0?(this.checkpointScanFrameService.clearScan(),this.toastMessageService.showToastPanel(n.getSuccessDefaultConfig().withMessage(this.translateService.instant("MSG_ITEM_FLAG_RAG")))):this.toastMessageService.showToastPanel(n.getErrorDefaultConfig().withMessage(this.translateService.instant("MSG_NO_FLAG_ATTACHED_FOR_EVENT"))),this.router.navigate([r.MainPanel.path,r.Dialogs.CheckpointScan.path,C.Scan.path]).catch(v.EMPTY_REJECTION_HANDLER)})}static{this.\u0275fac=function(i){return new(i||e)(a(y),a(F),a(G),a(j),a(N))}}static{this.\u0275cmp=I({type:e,selectors:[["abs-menu-option-out-frame"]],decls:14,vars:9,consts:[[1,"out-frame-container"],[1,"out-frame-tile-card",3,"click"],["color","primary","svgIcon","stock-building-icon",1,"icon"],[1,"text"],[1,"or-label"],["color","primary","svgIcon","delete",1,"icon"]],template:function(i,c){i&1&&(o(0,"div",0)(1,"mat-card",1),_("click",function(){return c.actionReturnToStock()}),g(2,"mat-icon",2),o(3,"div",3),h(4),S(5,"translate"),l()(),o(6,"div",4),h(7),S(8,"translate"),l(),o(9,"mat-card",1),_("click",function(){return c.actionRag()}),g(10,"mat-icon",5),o(11,"div",3),h(12),S(13,"translate"),l()()()),i&2&&(p(4),u(d(5,3,"LBL_RETURN_TO_STOCK")),p(3),u(d(8,5,"LBL_OR")),p(5),u(d(13,7,"LBL_RAG")))},dependencies:[A,w,R],encapsulation:2})}}return e})();var B=[{path:"",component:P}],x=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=m({type:e})}static{this.\u0275inj=s({imports:[T.forChild(B),T]})}}return e})();var fe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=m({type:e})}static{this.\u0275inj=s({imports:[O,k,D,L,x]})}}return e})();export{fe as MenuOptionOutModule};
