File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/9523.9943b6bfeea79262.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9523,2697,4769,5553,7150,9531,7934,1337,315],{55553:(j,u,o)=>{o.d(u,{h:()=>f});var t=o(77897),C=o(56610),r=o(41683),v=o(13721),E=o(22882),P=o(37222),d=o(36594),e=o(2978);let f=(()=>{class _{static#t=this.\u0275fac=function(S){return new(S||_)};static#e=this.\u0275mod=e.$C({type:_});static#n=this.\u0275inj=e.G2t({imports:[C.MD,t.bv,v.h,r.Y,E.h.forChild(),P.YN,d.rJ]})}return _})()},81337:(j,u,o)=>{o.d(u,{O:()=>P});var t=o(2978),C=o(56610),r=o(77897);function v(d,e){if(1&d&&t.nrm(0,"img",5),2&d){const f=t.XpG();t.FS9("src",f.emptySettingsSlide.urlImage,t.B4B)}}function E(d,e){if(1&d&&(t.j41(0,"p"),t.EFF(1),t.k0s()),2&d){const f=t.XpG();t.R7$(1),t.SpI(" ",f.emptySettingsSlide.text," ")}}let P=(()=>{class d{constructor(){this.emptySettingsSlide=[],this.slideOpts={allowSlidePrev:!1,allowSlideNext:!1,initialSlide:1,speed:400}}ngOnInit(){}static#t=this.\u0275fac=function(_){return new(_||d)};static#e=this.\u0275cmp=t.VBU({type:d,selectors:[["app-empty-component"]],inputs:{emptySettingsSlide:"emptySettingsSlide"},decls:6,vars:3,consts:[["pager","false",3,"options"],[1,"slide_center"],[1,"slide"],["alt","image_camponent",3,"src",4,"ngIf"],[4,"ngIf"],["alt","image_camponent",3,"src"]],template:function(_,I){1&_&&(t.j41(0,"ion-slides",0)(1,"ion-slide",1)(2,"div",2),t.DNE(3,v,1,1,"img",3),t.j41(4,"ion-label"),t.DNE(5,E,2,1,"p",4),t.k0s()()()()),2&_&&(t.Y8G("options",I.slideOpts),t.R7$(3),t.Y8G("ngIf",I.emptySettingsSlide.showImage),t.R7$(2),t.Y8G("ngIf",I.emptySettingsSlide.showText))},dependencies:[C.bT,r.he,r.q3,r.tR],styles:["ion-slides[_ngcontent-%COMP%]{height:100%}.swiper-slide[_ngcontent-%COMP%]{display:block}.swiper-slide[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:2.8rem}.swiper-slide[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:50%;max-width:40%;margin:60px 0 40px;pointer-events:none}b[_ngcontent-%COMP%]{font-weight:500}p[_ngcontent-%COMP%]{padding:0 40px;font-size:14px;line-height:1.5;color:var(--ion-color-step-600, #60646b)}p[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--ion-text-color, #000000)}.slide_center[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}"]})}return d})()},67433:(j,u,o)=>{o.d(u,{E:()=>Y});var t=o(2978),C=o(56610),r=o(77897);function v(l,h){1&l&&(t.j41(0,"ion-thumbnail",7),t.nrm(1,"ion-skeleton-text"),t.k0s())}function E(l,h){if(1&l&&(t.j41(0,"ion-item"),t.DNE(1,v,2,0,"ion-thumbnail",3),t.j41(2,"ion-label")(3,"h3"),t.nrm(4,"ion-skeleton-text",4),t.k0s(),t.j41(5,"p"),t.nrm(6,"ion-skeleton-text",5),t.k0s(),t.j41(7,"p"),t.nrm(8,"ion-skeleton-text",6),t.k0s()()()),2&l){const p=t.XpG(2);t.R7$(1),t.Y8G("ngIf",p.image)}}const P=function(){return[1,1,1,1,1,1,1]};function d(l,h){1&l&&(t.j41(0,"ion-list")(1,"ion-list-header"),t.nrm(2,"ion-skeleton-text",1),t.k0s(),t.DNE(3,E,9,1,"ion-item",2),t.k0s()),2&l&&(t.R7$(3),t.Y8G("ngForOf",t.lJ4(1,P)))}function e(l,h){1&l&&(t.j41(0,"ion-card"),t.nrm(1,"ion-skeleton-text",8),t.k0s())}const f=function(){return[1,1,1]};function _(l,h){1&l&&(t.j41(0,"div"),t.DNE(1,e,2,0,"ion-card",2),t.k0s()),2&l&&(t.R7$(1),t.Y8G("ngForOf",t.lJ4(1,f)))}function I(l,h){1&l&&(t.j41(0,"ion-col",11)(1,"ion-card"),t.nrm(2,"ion-skeleton-text",12),t.k0s()())}function y(l,h){1&l&&(t.j41(0,"ion-col",13)(1,"ion-card"),t.nrm(2,"ion-skeleton-text",12),t.k0s()())}function S(l,h){1&l&&(t.j41(0,"ion-col",13)(1,"ion-card"),t.nrm(2,"ion-skeleton-text",12),t.k0s()())}function B(l,h){if(1&l&&(t.j41(0,"ion-row"),t.DNE(1,I,3,0,"ion-col",9),t.DNE(2,y,3,0,"ion-col",10),t.DNE(3,S,3,0,"ion-col",10),t.k0s()),2&l){const p=t.XpG(2);t.R7$(1),t.Y8G("ngIf",p.size<=p.maximumCategoryCards),t.R7$(1),t.Y8G("ngIf",p.size>p.maximumCategoryCards),t.R7$(1),t.Y8G("ngIf",p.size>p.maximumCategoryCards)}}function N(l,h){1&l&&(t.j41(0,"div")(1,"ion-card"),t.nrm(2,"ion-skeleton-text",8),t.k0s(),t.j41(3,"ion-grid"),t.DNE(4,B,4,3,"ion-row",2),t.k0s()()),2&l&&(t.R7$(4),t.Y8G("ngForOf",t.lJ4(1,f)))}let Y=(()=>{class l{constructor(){this.image=!0,this.iscard=!1,this.islist=!1,this.iscardhome=!1,this.maximumCategoryCards=4}ngOnInit(){}static#t=this.\u0275fac=function(O){return new(O||l)};static#e=this.\u0275cmp=t.VBU({type:l,selectors:[["app-skeleton-progress"]],inputs:{image:"image",iscard:"iscard",islist:"islist",iscardhome:"iscardhome",size:"size"},decls:3,vars:3,consts:[[4,"ngIf"],["animated","",2,"width","80px"],[4,"ngFor","ngForOf"],["slot","start",4,"ngIf"],["animated","",2,"width","80%"],["animated","",2,"width","60%"],["animated","",2,"width","30%"],["slot","start"],["animated","",1,"ion-no-margin","card_skeleton"],["size","12",4,"ngIf"],["size","6",4,"ngIf"],["size","12"],["animated","",1,"ion-no-margin","card_skeleton_small"],["size","6"]],template:function(O,b){1&O&&(t.DNE(0,d,4,2,"ion-list",0),t.DNE(1,_,2,2,"div",0),t.DNE(2,N,5,2,"div",0)),2&O&&(t.Y8G("ngIf",b.islist),t.R7$(1),t.Y8G("ngIf",b.iscard),t.R7$(1),t.Y8G("ngIf",b.iscardhome))},dependencies:[C.Sq,C.bT,r.b_,r.hU,r.lO,r.uz,r.he,r.nf,r.AF,r.ln,r.ds,r.Zx],styles:[".card_skeleton[_ngcontent-%COMP%]{height:214px}.card_skeleton_small[_ngcontent-%COMP%]{height:125px}"]})}return l})()},29523:(j,u,o)=>{o.r(u),o.d(u,{UserCardsPageModule:()=>z});var t=o(56610),C=o(37222),r=o(77897),v=o(36075),E=o(73308),P=o(72979),d=o(29606),e=o(2978),f=o(29885),_=o(57291),I=o(7125),y=o(22882),S=o(81337),B=o(67433);const N=["barCanvas"];function Y(c,D){1&c&&e.nrm(0,"app-skeleton-progress",7),2&c&&e.Y8G("iscard",!0)}function l(c,D){if(1&c&&e.nrm(0,"app-empty-component",8),2&c){const n=e.XpG();e.Y8G("emptySettingsSlide",n.emptySettingsSlide)}}function h(c,D){if(1&c){const n=e.RV6();e.j41(0,"ion-card",10),e.nrm(1,"canvas",11,12),e.j41(3,"ion-fab",13)(4,"ion-fab-button",14),e.bIt("click",function(){const s=e.eBV(n).$implicit,g=e.XpG(2);return e.Njj(g.optionImage("canvasid_"+s.identification,"share"))}),e.nrm(5,"ion-icon",15),e.k0s()()()}if(2&c){const n=D.$implicit;e.R7$(1),e.Mz_("id","canvasid_",n.identification,"")}}function p(c,D){if(1&c&&(e.j41(0,"div"),e.DNE(1,h,6,1,"ion-card",9),e.k0s()),2&c){const n=e.XpG();e.R7$(1),e.Y8G("ngForOf",n.userCards)}}function O(c,D){if(1&c){const n=e.RV6();e.j41(0,"ion-infinite-scroll",16),e.bIt("ionInfinite",function(i){e.eBV(n);const s=e.XpG();return e.Njj(s.loadData(i))}),e.nrm(1,"ion-infinite-scroll-content",17),e.nI1(2,"translate"),e.k0s()}2&c&&(e.R7$(1),e.FS9("loadingText",e.bMT(2,1,"all.loading")))}const L=[{path:"",component:(()=>{class c{constructor(n,a,i,s,g){this.userProvider=n,this.storage=a,this.cityProvider=i,this.translateService=s,this.navCtrl=g,this.offset=0,this.take=10}ngOnInit(){this.emptySettingsSlide={showImage:!1,urlImage:"",showText:!0,text:this.translateService.instant("NOT_USER_CARDS")},this.storage.get("infoUser").then(n=>{this.userInfo=n}),this.getUserCards()}toggleInfiniteScroll(){this.infiniteScroll.disabled=!this.infiniteScroll.disabled}getUserCards(n){var a=this;return(0,E.A)(function*(){(yield a.userProvider.getUserCards(a.take,a.offset,"subscriber")).subscribe(i=>{a.userCards||(a.userCards=[]),a.userCards.push(...i),a.paintImageCanvas(),n&&(n.target.complete(),a.offset>a.userCards.length&&!a.infiniteScroll.disabled&&a.toggleInfiniteScroll())},i=>{a.userCards=null,console.log("error getUserCards: ",i)})})()}loadData(n){this.offset+=10,this.getUserCards(n)}paintImageCanvas(){var n=this;setTimeout(()=>{this.canvaslist.forEach(function(){var a=(0,E.A)(function*(i){let s=i.nativeElement.getContext("2d");i.nativeElement.width=600;let g=new Image;g.crossOrigin="*";let T=i.nativeElement.id;T=T.slice(9);let m=n.userCards.find(R=>R.identification==T),M=n.userInfo.first_name+" "+n.userInfo.last_name,w=n.userInfo.document,F=n.userInfo.document_type?n.userInfo.document_type.alias:"",U=m.name,x=m.optional?m.optional:"",k=m.font_type,G=m.font_color,X=(F?F+": "+w:w).toUpperCase();var $;M=M.toUpperCase(),U=U.toUpperCase(),x=x.toUpperCase(),$=m.optionalSeat?{u:n.userInfo.id,c:m.id,s:m.optionalSeat}:{u:n.userInfo.id,c:m.id};let A=new Image;A.src=String(yield n.generateQR(JSON.stringify($))),g.onload=()=>{i.nativeElement.height=i.nativeElement.width*(g.height/g.width),s.drawImage(g,0,0,i.nativeElement.width,i.nativeElement.height),s.beginPath(),s.fillStyle=G||"white",s.font=k?"bold 26px "+k:"bold 28px Arial black",s.textAlign="left",s.fillText(M.length>23?M.substring(0,22)+"...":M,20,215),s.font=k?"22px "+k:"bold 22px Arial",s.fillText(U.length>30?U.substring(0,29)+"...":U,20,240),s.fillText(X,i.nativeElement.width/4,265),x&&s.fillText(x.length>30?x.substring(0,29)+"...":x,i.nativeElement.width/4,290),s.fillStyle=G||"#edd549",s.fillText("> ",i.nativeElement.width/4-20,265),x&&s.fillText("\u2714 ",i.nativeElement.width/4-20,290),s.drawImage(A,i.nativeElement.width-130,i.nativeElement.height-200,110,110),s.closePath()},g.src=(yield n.cityProvider.getGalleryUrl())+"carnet/"+m.image});return function(i){return a.apply(this,arguments)}}())},500)}generateQR(n){return new Promise((a,i)=>{P.toDataURL(n,{errorCorrectionLevel:"H",quality:1,margin:2},function(T,m){a(m)})})}optionImage(n,a){if("share"==a){let s=this.canvaslist.find(m=>m.nativeElement.id==n).nativeElement.toDataURL(),g=s.split("/")[1].split(";")[0],T=s.split(",")[1];d.Y.share({filename:(new Date).getTime()+"."+g,contentType:"application/"+g,base64Data:T}).then(()=>{}).catch(m=>{console.error("File sharing failed",m.message)})}else window.canvas2ImagePlugin.saveImageDataToLibrary(function(i){console.log(i)},function(i){console.log(i)},document.getElementById(n))}static#t=this.\u0275fac=function(a){return new(a||c)(e.rXU(f.D),e.rXU(_.n),e.rXU(I.h),e.rXU(y.c$),e.rXU(r.q9))};static#e=this.\u0275cmp=e.VBU({type:c,selectors:[["app-user-cards"]],viewQuery:function(a,i){if(1&a&&(e.GBs(r.Ax,5),e.GBs(N,5)),2&a){let s;e.mGM(s=e.lsd())&&(i.infiniteScroll=s.first),e.mGM(s=e.lsd())&&(i.canvaslist=s)}},decls:11,vars:7,consts:[[1,"ion-no-border"],["slot","start"],[1,"ion-text-center"],[3,"iscard",4,"ngIf"],[3,"emptySettingsSlide",4,"ngIf"],[4,"ngIf"],["threshold","100px",3,"ionInfinite",4,"ngIf"],[3,"iscard"],[3,"emptySettingsSlide"],["class","h-214",4,"ngFor","ngForOf"],[1,"h-214"],["crossorigin","anonymous",1,"imageCard",3,"id"],["barCanvas",""],[1,"fab_button"],["color","light",3,"click"],["ios","share-outline","md","share-social-outline"],["threshold","100px",3,"ionInfinite"],["loadingSpinner","bubbles",3,"loadingText"]],template:function(a,i){1&a&&(e.j41(0,"ion-header",0)(1,"ion-toolbar"),e.nrm(2,"ion-back-button",1),e.j41(3,"ion-title",2),e.EFF(4),e.nI1(5,"translate"),e.k0s()()(),e.j41(6,"ion-content"),e.DNE(7,Y,1,1,"app-skeleton-progress",3),e.DNE(8,l,1,1,"app-empty-component",4),e.DNE(9,p,2,1,"div",5),e.DNE(10,O,3,3,"ion-infinite-scroll",6),e.k0s()),2&a&&(e.R7$(4),e.JRh(e.bMT(5,5,"TITLE_HOME_SUB_BUTTON4")),e.R7$(3),e.Y8G("ngIf",!i.userCards),e.R7$(1),e.Y8G("ngIf",i.userCards&&!i.userCards.length),e.R7$(1),e.Y8G("ngIf",i.userCards&&i.userCards.length),e.R7$(1),e.Y8G("ngIf",i.userCards))},dependencies:[t.Sq,t.bT,r.el,r.b_,r.W9,r.Q8,r.YW,r.eU,r.iq,r.Ax,r.Hp,r.BC,r.ai,r.tY,S.O,B.E,y.D9],styles:[".imageCard[_ngcontent-%COMP%]{width:100%;height:214px}.h-214[_ngcontent-%COMP%]{height:214px;position:relative}.label_image[_ngcontent-%COMP%]{position:absolute;top:56%;left:6%;font-size:14px;width:135px}.fab_button[_ngcontent-%COMP%]{position:absolute;bottom:0;right:0}.fab_button_download[_ngcontent-%COMP%]{position:absolute;bottom:0;right:65px}"]})}return c})()}];let W=(()=>{class c{static#t=this.\u0275fac=function(a){return new(a||c)};static#e=this.\u0275mod=e.$C({type:c});static#n=this.\u0275inj=e.G2t({imports:[v.iI.forChild(L),v.iI]})}return c})();var K=o(55553);let z=(()=>{class c{static#t=this.\u0275fac=function(a){return new(a||c)};static#e=this.\u0275mod=e.$C({type:c});static#n=this.\u0275inj=e.G2t({imports:[t.MD,C.YN,r.bv,W,y.h.forChild(),K.h]})}return c})()}}]);