import{a as P}from"./chunk-N72SJKDY.js";import{a as V,b as _}from"./chunk-WILJ4NWD.js";import"./chunk-CINMPGTU.js";import{a as p}from"./chunk-NFVWZZNN.js";import"./chunk-OQ3MLAX5.js";import"./chunk-KOXD6BDO.js";import{Va as x}from"./chunk-D2E2EQ56.js";import"./chunk-XVWHZ5TH.js";import{s as g}from"./chunk-GYAYEJFB.js";import{ya as w}from"./chunk-ZZKAL5UM.js";import{Bb as l,Gb as m,L as n,Ub as o,_b as h,dc as f,ec as C,fc as u,nb as c,qc as v,sb as a}from"./chunk-LEOKSAW2.js";import"./chunk-FK6H3RFT.js";import"./chunk-53LFMTPK.js";import"./chunk-HE7HQ6LI.js";import{a as s}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,"wk-message-bar",1),e&2&&o("fullSize",!0)}var d=(()=>{class e{constructor(t,i,r){this._printViewServiceApi=t,this._activatedRoute=i,this._printViewService=r,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(s({},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(s({},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,r){i&1&&m(0,R,3,1,"div",0)(1,b,1,1,"wk-message-bar",1),i&2&&h(r.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};
