import{a as Y,b as $,c as H}from"./chunk-HHGPGR2L.js";import{a as K}from"./chunk-WAUVOWVZ.js";import{a as W}from"./chunk-Q6YQJFNJ.js";import{a as U}from"./chunk-IGLJBRXL.js";import{b as j}from"./chunk-SPNVV2KO.js";import{e as L,p as N,w as G}from"./chunk-BGV4AOSB.js";import"./chunk-2SZ4MB2K.js";import"./chunk-N7PC5CHF.js";import{j as O,q as z}from"./chunk-ZTKV4AIV.js";import{cb as Q,db as A}from"./chunk-JIDGXFMJ.js";import"./chunk-MTR2L2TG.js";import"./chunk-5JDCLYZA.js";import{j as J,n as R}from"./chunk-YJYOGSOO.js";import"./chunk-73IMXZSJ.js";import{m as P}from"./chunk-KVTHJWZA.js";import{Ab as w,Bc as E,Hb as g,Ic as a,Jc as c,Lc as M,Ob as y,Sb as o,Tb as r,Ub as f,Va as V,Yb as F,hb as i,ic as x,jc as b,mb as I,mc as B,na as h,qa as q,uc as v,va as u,vc as l,wa as _,wc as k,xc as C}from"./chunk-FWZCAEAJ.js";import{f as D}from"./chunk-CWTPBX7D.js";function ee(n,t){if(n&1&&(o(0,"p",17),l(1),a(2,"tr"),r()),n&2){let p=b();i(),k(c(2,1,p.info))}}function te(n,t){if(n&1){let p=F();o(0,"div",1)(1,"div",2),f(2,"qrcode",3),r(),o(3,"div",4)(4,"div",5),l(5),a(6,"tr"),r(),o(7,"div",6),w(8,ee,3,3,"p",7),o(9,"a",8),l(10),a(11,"s_cut"),r()(),o(12,"div",9)(13,"scrollable-toolbar")(14,"button",10),x("click",function(){u(p);let e=b();return _(e.back())}),f(15,"bi",11),l(16),a(17,"tr"),r(),o(18,"button",12),x("click",function(){u(p);let e=b();return _(e.print())}),f(19,"bi",13),l(20),a(21,"tr"),r(),o(22,"button",14,15),x("click",function(){u(p);let e=v(24),s=v(23);return _(s.copy(e))}),a(25,"tr"),f(26,"bi",16),l(27),a(28,"tr"),r()()()()()}if(n&2){let p=b();i(2),g("size",p.isMobile()?8:14)("margin",0)("data",t.data),i(3),C(" ",c(6,13,t.text)," "),i(3),y(8,t.info.length>0?8:-1),i(),g("href",t.data,V)("ngbTooltip",t.data),i(),k(M(11,15,t.data,82,"...")),i(6),C(" ",c(17,19,"GO_BACK")," "),i(4),C(" ",c(21,21,"PRINT")," "),i(2),B("ngbTooltip",c(25,23,"COPIED")),g("copyable",t.data),i(5),C(" ",c(28,25,"COPY")," ")}}var xe=(()=>{let t=class t{constructor(){this.qrCodeData=h(U).data,this.window=L(),this.isMobile=G(),this.location=h(P),this.translate=R(),this.back=()=>this.location.back(),I(()=>{this.qrCodeData()||this.back()})}print(){return D(this,null,function*(){let d=document.getElementById("qrcode"),e=new $("p","pt","a4",!0),s=yield Y(d,{quality:.7,backgroundColor:"#FFFFFF"});e.addImage(s,"JPEG",70,20,450,450);let m=this.qrCodeData()?.info;if(m&&m.length>0){let X=yield this.translate(m),T=500;for(let S of z(X,50)){let Z=e.internal.pageSize.width/2-e.getStringUnitWidth(S)*e.getFontSize()/2;e.text(S,Z,T),T+=20}}e.save(`qrcode-${O(new Date)}.pdf`)})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=q({type:t,selectors:[["app-qr-code"]],standalone:!0,features:[E],decls:1,vars:1,consts:[["class","my-container d-flex flex-row flex-wrap gap-5 align-items-center justify-content-center h-100"],[1,"my-container","d-flex","flex-row","flex-wrap","gap-5","align-items-center","justify-content-center","h-100"],["id","qrcode",1,"qrcode-rounded"],["errorCorrectionLevel","M","colorLight","#f6f6f6",3,"size","margin","data"],[1,"card"],[1,"card-header"],[1,"card-body"],["id","info-text","class","card-text"],["target","_blank","rel","noopener",3,"href","ngbTooltip"],[1,"card-footer","text-muted"],[1,"btn","btn-sm","btn-secondary",3,"click"],["name","arrow-left"],[1,"btn","btn-sm","btn-info",3,"click"],["name","printer","aria-label","Copy content to clipboard"],["autoClose","false","triggers","manual","aria-label","Copy link","placement","right",1,"btn","btn-sm","btn-primary",3,"copyable","ngbTooltip","click"],["c","copy","t","ngbTooltip"],["name","clipboard","aria-label","Copy content to clipboard"],["id","info-text",1,"card-text"]],template:function(e,s){if(e&1&&w(0,te,29,27,"div",0),e&2){let m;y(0,(m=s.qrCodeData())?0:-1,m)}},dependencies:[H,A,Q,j,W,K,N,J],styles:[".my-container[_ngcontent-%COMP%]{padding-top:5rem}.qrcode-rounded[_ngcontent-%COMP%]{border-radius:15px;border-width:5px;background-color:#f6f6f6;padding:15px;filter:brightness(125%)}"],changeDetection:0});let n=t;return n})();export{xe as AppQrCodeViewComponent};
