import{a as P}from"./chunk-6PLQEBGN.js";import{a as V,b as _}from"./chunk-SPSRGXCK.js";import{a as p}from"./chunk-NFVWZZNN.js";import{a as x}from"./chunk-QJE6KE7P.js";import"./chunk-IF6GMCTP.js";import"./chunk-KOXD6BDO.js";import{r as g}from"./chunk-EMTGVP7F.js";import{ya as w}from"./chunk-ONNJVTQI.js";import{Ab as l,Fb as m,K as n,Tb as o,Zb as h,cc as f,dc as C,ec as u,mb as c,pc as v,rb as a}from"./chunk-A4WWLITB.js";import"./chunk-QOJKCMZT.js";import{a as r}from"./chunk-K4ALXBGI.js";function R(e,S){if(e&1&&(f(0,"div",0)(1,"div",2),u(2,"tis-print-view-content",3),C()()),e&2){let t=v();c(2),o("data",t.dataWithClassName)}}function b(e,S){e&1&&u(0,"tis-message-bar",1),e&2&&o("fullSize",!0)}var d=(()=>{class e{constructor(t,i,s){this._printViewServiceApi=t,this._activatedRoute=i,this._printViewService=s,this.fullUrl="",this.returnMode=!1,this.notFound=!1,this.dataWithClassName=[],this.data={cmp:"",stmp:0,dc:"",fd:!1}}ngOnInit(){this.fullUrl=location.href,this.returnMode=this.fullUrl.toLowerCase().indexOf("return")>-1,this._activatedRoute.queryParams.pipe(n(1)).subscribe(t=>{this.data.cmp=t.cmp,this.data.stmp=t.stmp,this.data.dc=t.dc,this.data.fd=t.fd==="true",!(!this.data.cmp||!this.data.stmp||!this.data.dc)&&(this.returnMode?this.getReturnPrint(this.data):this.getSellPrint(this.data))})}getSellPrint(t){this._printViewServiceApi.getSellPrintView(r({},t),p.KazRus).pipe(n(1)).subscribe({next:i=>{this.notFound=!1,this.dataWithClassName=i,this.dataWithClassName.length&&this._printViewService.addedClasses(this.dataWithClassName)},error:()=>{this.notFound=!0}})}getReturnPrint(t){this._printViewServiceApi.getReturnSellPrintView(r({},t),p.KazRus).pipe(n(1)).subscribe({next:i=>{this.notFound=!1,this.dataWithClassName=i,this.dataWithClassName.length&&this._printViewService.addedClasses(this.dataWithClassName)},error:()=>{this.notFound=!0}})}static{this.\u0275fac=function(i){return new(i||e)(a(V),a(g),a(_))}}static{this.\u0275cmp=l({type:e,selectors:[["tis-product-receipt-view"]],decls:2,vars:1,consts:[[1,"receipt"],["type","info","title","\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D","secondaryText","\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0447\u0435\u043A \u0435\u0449\u0435 \u043D\u0435 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D.",3,"fullSize"],[1,"print-view"],[3,"data"]],template:function(i,s){i&1&&m(0,R,3,1,"div",0)(1,b,1,1,"tis-message-bar",1),i&2&&h(s.dataWithClassName.length?0:1)},dependencies:[P,w,x],styles:[".receipt[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.print-view[_ngcontent-%COMP%]{width:max-content;overflow:auto;display:flex;flex-direction:column;gap:10px;font-size:14px;margin:10px 0;padding:15px;border-radius:4px;box-shadow:1px 0 12px 0 var(--color-brand-90)}"]})}}return e})();var T=[{path:"sell",component:d,pathMatch:"full"},{path:"return",component:d,pathMatch:"full"}];export{T as routes};
