import{a as b}from"./chunk-HCZQBPNH.js";import{d as l}from"./chunk-GPXQ2AOL.js";import{$b as C,Cb as x,Dc as w,De as v,Ec as y,Ue as O,Wb as _,Yb as g,Zb as h,ac as u,bc as p,cc as s,dc as c,ec as m,gb as f,kb as a,pc as r}from"./chunk-PVUKHE45.js";function F(e,n){if(e&1&&(s(0,"div",0),m(1,"img",3),c()),e&2){let o=r().$implicit;a(),p("src","data:image/jpeg;base64,"+o.value,f)}}function S(e,n){if(e&1&&(s(0,"pre",1),w(1),c()),e&2){let o=r(),i=o.$implicit,t=o.$index,d=r();p("ngStyle",d.styleObj[t]),a(),y(i.value)}}function T(e,n){if(e&1&&(s(0,"div",2),m(1,"qrcode",4),c()),e&2){let o=r().$implicit;a(),p("qrdata",o.value)("cssClass","center")("elementType","svg")("width",175)}}function P(e,n){if(e&1&&_(0,F,2,1,"div",0)(1,S,2,2,"pre",1)(2,T,2,4,"div",2),e&2){let o,i=n.$implicit,t=r();g((o=i.type)===t.printFormat.image?0:o===t.printFormat.text?1:o===t.printFormat.qrCode?2:-1)}}var D=(()=>{let n=class n{constructor(){this.printFormat={text:l.Text,image:l.Image,qrCode:l.QrCode},this.styleObj=[]}set data(i){i&&(this._data=i,this._processData())}get data(){return this._data}_processData(){this.styleObj=[],this.data&&this.data.forEach(i=>{this._getStyle(i.className||"")})}_getStyle(i){let t={"font-weight":"500","font-size":"12px","font-style":"","text-decoration":"","line-height":"14px"};i.indexOf("bold")>-1&&(t["font-weight"]="700",t["line-height"]="28px"),i.indexOf("doubleWidth")>-1&&(t["font-size"]="24px",t["line-height"]="28px"),i.indexOf("italic")>-1&&(t["font-style"]="italic"),i.indexOf("underline")>-1&&(t["text-decoration"]="underline"),this.styleObj.push(t)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=x({type:n,selectors:[["tis-print-view-content"]],inputs:{data:"data"},decls:2,vars:0,consts:[[1,"print-image-wrapper"],[2,"margin","0","white-space","pre-wrap","word-wrap","break-word",3,"ngStyle"],[2,"text-align","center"],["alt","logo",1,"print-image",3,"src"],[3,"qrdata","cssClass","elementType","width"]],template:function(t,d){t&1&&C(0,P,3,1,null,null,h),t&2&&u(d.data)},dependencies:[O,v,b],styles:[`[_nghost-%COMP%]{display:flex;flex-direction:column}.print-image-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;width:300px;overflow:hidden;align-self:center}.print-image[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;height:auto;object-fit:contain}
/*# sourceMappingURL=print-view-content.component-323EERSZ.css.map */`]});let e=n;return e})();export{D as a};
//# sourceMappingURL=chunk-VJ3IHOCD.js.map
