File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/199.fe45864b8f88b8a6.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[199,5553,7934,315],{93636:(M,U,l)=>{l.d(U,{D:()=>A});var u=l(73308),t=l(2978),_=l(41808),R=l(54171),F=l(22882),e=l(57992),T=l(56610),E=l(77897);function I(d,o){if(1&d&&(t.j41(0,"p",12),t.EFF(1),t.k0s()),2&d){const i=t.XpG(2);t.xc7("background-color",i.academyUser.academy_state.color),t.R7$(1),t.Lme("",i.academyUser.academy_state.name," ","CONFIRMADA"==i.academyUser.review_state?"":"SIN DATOS"==i.academyUser.review_state?"(PENDIENTE)":"(EN REVISI\xd3N)","")}}function v(d,o){if(1&d&&(t.j41(0,"ion-label"),t.EFF(1),t.k0s()),2&d){const i=t.XpG(2);t.R7$(1),t.SpI(" ",i.academyUser.academy_category.name," ")}}function x(d,o){if(1&d){const i=t.RV6();t.j41(0,"ion-card",1),t.DNE(1,I,2,4,"p",2),t.j41(2,"p",3),t.EFF(3),t.k0s(),t.j41(4,"ion-item",4)(5,"div",5),t.bIt("click",function(){t.eBV(i);const r=t.sdS(7),s=t.XpG();return t.Njj(s.actionSheetImage(r))}),t.nrm(6,"input",6,7)(8,"img",8),t.j41(9,"span"),t.nrm(10,"ion-icon",9),t.k0s()(),t.j41(11,"div")(12,"ion-label",10),t.EFF(13),t.k0s(),t.DNE(14,v,2,1,"ion-label",11),t.k0s()()()}if(2&d){const i=t.XpG();t.R7$(1),t.Y8G("ngIf",i.academyUser.academy_state&&i.academyUser.academy_state.app_components.includes("Etiqueta estado")),t.R7$(2),t.Lme(" ",i.academyUser.student_document_type.alias," ",i.academyUser.identification," "),t.R7$(5),t.FCK("src","",i.academyUser.photo?i.academyUser.photo:"assets/img/default.png","?_dc=",i.time,"",t.B4B),t.R7$(5),t.Lme(" ",i.academyUser.student_name," ",i.academyUser.student_last_name," "),t.R7$(1),t.Y8G("ngIf",i.academyUser.academy_category)}}let A=(()=>{class d{constructor(i,n,r,s){this.photoService=i,this.utilsService=n,this.translateService=r,this.academyService=s,this.uploadPhoto=new t.bkB}ngOnInit(){this.time=(new Date).getTime()}actionSheetImage(i){var n=this;return(0,u.A)(function*(){n.photoService.actionSheetImage(i).then(r=>{let s={academy_user:n.academyUser,photo:r};n.utilsService.presentLoading(n.translateService.instant("all.loading")).then(()=>{n.academyService.updateUserPhoto(s).then(function(){var m=(0,u.A)(function*(p){p.r&&(n.utilsService.presentToast(4e3,"success","top",p.m),n.uploadPhoto.emit(!0),n.utilsService.dismissLoading())});return function(p){return m.apply(this,arguments)}}(),m=>{console.log("error enrollmentAcademy: ",m),n.utilsService.dismissLoading()})})})})()}static#e=this.\u0275fac=function(n){return new(n||d)(t.rXU(_.I),t.rXU(R.T),t.rXU(F.c$),t.rXU(e.k))};static#t=this.\u0275cmp=t.VBU({type:d,selectors:[["app-card-academy-user"]],inputs:{academyUser:"academyUser"},outputs:{uploadPhoto:"uploadPhoto"},decls:1,vars:1,consts:[["class","h-214 card_container",4,"ngIf"],[1,"h-214","card_container"],["class","stateTag responsive-text-title",3,"background-color",4,"ngIf"],[1,"stateId","responsive-text-title"],["lines","inset"],["slot","start",1,"item-image",3,"click"],["type","file","accept","image/*",2,"display","none"],["fileInput",""],[1,"imageUserProfile",3,"src"],["name","camera",1,"ion-no-margin","notify-badge"],[2,"font-weight","bold"],[4,"ngIf"],[1,"stateTag","responsive-text-title"]],template:function(n,r){1&n&&t.DNE(0,x,15,8,"ion-card",0),2&n&&t.Y8G("ngIf",r.academyUser)},dependencies:[T.bT,E.b_,E.iq,E.uz,E.he],styles:[".notify-badge[_ngcontent-%COMP%]{position:absolute;left:75px;top:70px;text-align:center;border-radius:30px;padding:4px;font-size:20px;background:lightgray}.imageUserProfile[_ngcontent-%COMP%]{display:block!important;width:75px;height:75px;max-width:75px;max-height:75px;box-shadow:1px 2px 2px 1px gray;border-radius:12%;margin:15px 0}.stateTag[_ngcontent-%COMP%]{position:absolute;color:#fff;font-weight:700;padding:0 5px;text-transform:uppercase;text-align:center;box-shadow:1px 2px 2px 1px gray;border-radius:5px;right:0;bottom:0;margin:0 5px 7px 0;z-index:10}.stateId[_ngcontent-%COMP%]{position:absolute;font-weight:700;padding:0 5px;text-transform:uppercase;text-align:center;border-radius:5px;right:0;margin:5px;z-index:10}"]})}return d})()},55553:(M,U,l)=>{l.d(U,{h:()=>I});var u=l(77897),t=l(56610),_=l(41683),R=l(13721),F=l(22882),e=l(37222),T=l(36594),E=l(2978);let I=(()=>{class v{static#e=this.\u0275fac=function(d){return new(d||v)};static#t=this.\u0275mod=E.$C({type:v});static#a=this.\u0275inj=E.G2t({imports:[t.MD,u.bv,R.h,_.Y,F.h.forChild(),e.YN,T.rJ]})}return v})()},90199:(M,U,l)=>{l.r(U),l.d(U,{AcademyUserProfilePageModule:()=>S});var u=l(56610),t=l(37222),_=l(77897),R=l(36075),F=l(73308),e=l(2978),T=l(54171),E=l(22882),I=l(57992),v=l(93636);function x(c,b){if(1&c&&(e.j41(0,"div")(1,"ion-item",10)(2,"ion-label",11),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"ion-label",12),e.EFF(6),e.k0s()(),e.j41(7,"ion-item",10)(8,"ion-label",11),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"ion-label",12),e.EFF(12),e.k0s()()()),2&c){const a=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,4,"IDENTIFICATION_CARD"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_identification),e.R7$(3),e.SpI("",e.bMT(10,6,"RELATION"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_relation)}}function A(c,b){if(1&c&&(e.j41(0,"div")(1,"ion-item",10)(2,"ion-label",11),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"ion-label",12),e.EFF(6),e.k0s()(),e.j41(7,"ion-item",10)(8,"ion-label",11),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"ion-label",12),e.EFF(12),e.k0s()(),e.j41(13,"ion-item",10)(14,"ion-label",11),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"ion-label",12),e.EFF(18),e.k0s()(),e.j41(19,"ion-item",10)(20,"ion-label",11),e.EFF(21),e.nI1(22,"translate"),e.k0s(),e.j41(23,"ion-label",12),e.EFF(24),e.k0s()(),e.j41(25,"ion-item",10)(26,"ion-label",11),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"ion-label",12),e.EFF(30),e.k0s()(),e.j41(31,"ion-item",10)(32,"ion-label",11),e.EFF(33),e.nI1(34,"translate"),e.k0s(),e.j41(35,"ion-label",12),e.EFF(36),e.k0s()(),e.j41(37,"ion-item",10)(38,"ion-label",11),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.j41(41,"ion-label",12),e.EFF(42),e.k0s()()()),2&c){const a=e.XpG(2);e.R7$(3),e.SpI("",e.bMT(4,14,"NIT_WITH_DV"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_nit),e.R7$(3),e.SpI("",e.bMT(10,16,"SOCIAL_REASON"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_business_name),e.R7$(3),e.SpI("",e.bMT(16,18,"PROPERTY_NAME"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_property_name),e.R7$(3),e.SpI("",e.bMT(22,20,"PHONE"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_phone),e.R7$(3),e.SpI("",e.bMT(28,22,"CELL_PHONE"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_cell_phone),e.R7$(3),e.SpI("",e.bMT(34,24,"MAIL"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_mail),e.R7$(3),e.SpI("",e.bMT(40,26,"ADDRESS"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_address.direction)}}function d(c,b){if(1&c&&(e.j41(0,"ion-card",5)(1,"ion-accordion",18)(2,"ion-item",7),e.nrm(3,"ion-icon",19),e.j41(4,"ion-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",9)(8,"ion-item",10)(9,"ion-label",11),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.j41(12,"ion-label",12),e.EFF(13),e.k0s()(),e.j41(14,"ion-item",10)(15,"ion-label",11),e.EFF(16),e.nI1(17,"translate"),e.k0s(),e.j41(18,"ion-label",12),e.EFF(19),e.k0s()()()()()),2&c){const a=e.XpG(2);e.R7$(5),e.JRh(e.bMT(6,5,"HEALT_INFORMATION")),e.R7$(5),e.SpI("",e.bMT(11,7,"BLOOD_TYPE"),":"),e.R7$(3),e.JRh(a.academyUser.blood_type),e.R7$(3),e.SpI("",e.bMT(17,9,"EPS"),":"),e.R7$(3),e.JRh(a.academyUser.eps)}}function o(c,b){if(1&c&&(e.j41(0,"ion-item",10)(1,"ion-label",11),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"ion-label",12),e.EFF(5),e.k0s()()),2&c){const a=e.XpG(3);e.R7$(2),e.SpI("",e.bMT(3,2,"ACADEMY_PLACE"),":"),e.R7$(3),e.JRh(a.academyUser.academy_location.name)}}function i(c,b){if(1&c&&(e.j41(0,"ion-item",10)(1,"ion-label",11),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",12),e.EFF(5),e.k0s()()),2&c){const a=e.XpG(3);e.R7$(2),e.SpI("",e.bMT(3,2,"CATEGORY"),":"),e.R7$(3),e.JRh(a.academyUser.academy_category.name)}}function n(c,b){if(1&c&&(e.j41(0,"ion-item",10)(1,"ion-label",11),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",12),e.EFF(5),e.k0s()()),2&c){const a=e.XpG(3);e.R7$(2),e.SpI("",e.bMT(3,2,"SCHEDULE"),":"),e.R7$(3),e.JRh(a.academyUser.academy_schedule.name)}}function r(c,b){if(1&c&&(e.j41(0,"ion-card",5)(1,"ion-accordion",20)(2,"ion-item",7),e.nrm(3,"ion-icon",21),e.j41(4,"ion-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",9),e.DNE(8,o,6,4,"ion-item",22),e.DNE(9,i,6,4,"ion-item",22),e.DNE(10,n,6,4,"ion-item",22),e.k0s()()()),2&c){const a=e.XpG(2);e.R7$(5),e.JRh(e.bMT(6,4,"ACADEMY_INFORMATION")),e.R7$(3),e.Y8G("ngIf",a.academyUser.academy_location),e.R7$(1),e.Y8G("ngIf",a.academyUser.academy_category),e.R7$(1),e.Y8G("ngIf",a.academyUser.academy_schedule)}}function s(c,b){if(1&c&&(e.j41(0,"ion-card",5)(1,"ion-accordion",23)(2,"ion-item",7),e.nrm(3,"ion-icon",24),e.j41(4,"ion-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",9)(8,"ion-item",10)(9,"ion-label",11),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.j41(12,"ion-label",12),e.EFF(13),e.k0s()(),e.j41(14,"ion-item",10)(15,"ion-label",11),e.EFF(16),e.nI1(17,"translate"),e.k0s(),e.j41(18,"ion-label",12),e.EFF(19),e.k0s()()()()()),2&c){const a=e.XpG(2);let f,g;e.R7$(5),e.JRh(e.bMT(6,5,"UNIFORM_INFORMATION")),e.R7$(5),e.SpI("",e.bMT(11,7,"TSHIRT_SIZE"),":"),e.R7$(3),e.JRh(null!==(f=a.academyUser.tshirt_size)&&void 0!==f?f:""),e.R7$(3),e.SpI("",e.bMT(17,9,"UNIFORM_TYPE"),":"),e.R7$(3),e.JRh(null!==(g=a.academyUser.uniform_type)&&void 0!==g?g:"")}}const m=function(){return["first"]};function p(c,b){if(1&c){const a=e.RV6();e.j41(0,"ion-content")(1,"app-card-academy-user",3),e.bIt("uploadPhoto",function(){e.eBV(a);const g=e.XpG();return e.Njj(g.loadInit(100,!0))}),e.k0s(),e.j41(2,"ion-accordion-group",4)(3,"ion-card",5)(4,"ion-accordion",6)(5,"ion-item",7),e.nrm(6,"ion-icon",8),e.j41(7,"ion-label"),e.EFF(8),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"div",9)(11,"ion-item",10)(12,"ion-label",11),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"ion-label",12),e.EFF(16),e.k0s()(),e.j41(17,"ion-item",10)(18,"ion-label",11),e.EFF(19),e.nI1(20,"translate"),e.k0s(),e.j41(21,"ion-label",12),e.EFF(22),e.k0s()(),e.j41(23,"ion-item",10)(24,"ion-label",11),e.EFF(25),e.nI1(26,"translate"),e.k0s(),e.j41(27,"ion-label",12),e.EFF(28),e.k0s()()()()(),e.j41(29,"ion-card",5)(30,"ion-accordion",13)(31,"ion-item",7),e.nrm(32,"ion-icon",14),e.j41(33,"ion-label"),e.EFF(34),e.k0s()(),e.j41(35,"div",9)(36,"ion-item",10)(37,"ion-label",11),e.EFF(38),e.nI1(39,"translate"),e.k0s(),e.j41(40,"ion-label",12),e.EFF(41),e.k0s()(),e.j41(42,"ion-item",10)(43,"ion-label",11),e.EFF(44),e.nI1(45,"translate"),e.k0s(),e.j41(46,"ion-label",12),e.EFF(47),e.k0s()(),e.DNE(48,x,13,8,"div",2),e.DNE(49,A,43,28,"div",2),e.j41(50,"ion-item",10)(51,"ion-label",11),e.EFF(52),e.nI1(53,"translate"),e.k0s(),e.j41(54,"ion-label",12),e.EFF(55),e.k0s()()()()(),e.j41(56,"ion-card",5)(57,"ion-accordion",15)(58,"ion-item",7),e.nrm(59,"ion-icon",16),e.j41(60,"ion-label"),e.EFF(61),e.nI1(62,"translate"),e.k0s()(),e.j41(63,"div",9)(64,"ion-item",10)(65,"ion-label",11),e.EFF(66),e.nI1(67,"translate"),e.k0s(),e.j41(68,"ion-label",12),e.EFF(69),e.k0s()(),e.j41(70,"ion-item",10)(71,"ion-label",11),e.EFF(72),e.nI1(73,"translate"),e.k0s(),e.j41(74,"ion-label",12),e.EFF(75),e.k0s()(),e.j41(76,"ion-item",10)(77,"ion-label",11),e.EFF(78),e.nI1(79,"translate"),e.k0s(),e.j41(80,"ion-label",12),e.EFF(81),e.k0s()()()()(),e.DNE(82,d,20,11,"ion-card",17),e.DNE(83,r,11,6,"ion-card",17),e.DNE(84,s,20,11,"ion-card",17),e.k0s()()}if(2&c){const a=e.XpG();e.R7$(1),e.Y8G("academyUser",a.academyUser),e.R7$(1),e.Y8G("value",e.lJ4(51,m)),e.R7$(6),e.JRh(e.bMT(9,29,"STUDENT_INFORMATION")),e.R7$(5),e.SpI("",e.bMT(14,31,"SCHOOL"),":"),e.R7$(3),e.JRh(a.academyUser.school_name),e.R7$(3),e.SpI("",e.bMT(20,33,"SCHOOL_GRADE"),":"),e.R7$(3),e.JRh(a.academyUser.school_grade),e.R7$(3),e.SpI("",e.bMT(26,35,"birth_date"),":"),e.R7$(3),e.JRh(a.academyUser.birthdate),e.R7$(6),e.JRh(a.academyService.getAdvisorSectionTitle(a.academyUser.type_academy)),e.R7$(4),e.SpI("",e.bMT(39,37,"TYPE_PERSON"),":"),e.R7$(3),e.SpI(" ",a.translateService.instant("JURIDICAL_PERSON"==a.academyUser.type_person?"JURIDICAL_PERSON":"NATURAL_PERSON")," "),e.R7$(3),e.SpI("",e.bMT(45,39,"NAME_CARD"),":"),e.R7$(3),e.Lme(" ",a.academyUser.advisor_name," ",a.academyUser.advisor_last_name," "),e.R7$(1),e.Y8G("ngIf","NATURAL_PERSON"==a.academyUser.type_person||!a.academyUser.type_person),e.R7$(1),e.Y8G("ngIf","JURIDICAL_PERSON"==a.academyUser.type_person),e.R7$(3),e.SpI("",e.bMT(53,41,"OCCUPATION"),":"),e.R7$(3),e.JRh(a.academyUser.advisor_ocupation),e.R7$(6),e.JRh(e.bMT(62,43,"CONTACT_INFORMATION")),e.R7$(5),e.SpI("",e.bMT(67,45,"EMAIL"),":"),e.R7$(3),e.JRh(a.academyUser.mail),e.R7$(3),e.SpI("",e.bMT(73,47,"PHONE"),":"),e.R7$(3),e.JRh(a.academyUser.phone),e.R7$(3),e.JRh(e.bMT(79,49,"LABEL_ADDRESS")),e.R7$(3),e.JRh(a.academyUser.address.direction),e.R7$(1),e.Y8G("ngIf",a.academyUser.blood_type||a.academyUser.eps),e.R7$(1),e.Y8G("ngIf",a.academyUser.academy_location||a.academyUser.academy_category||a.academyUser.academy_schedule),e.R7$(1),e.Y8G("ngIf",a.academyUser.tshirt_size||a.academyUser.uniform_type)}}const y=[{path:"",component:(()=>{class c{constructor(a,f,g,j){this.route=a,this.utilsService=f,this.translateService=g,this.academyService=j}ngOnInit(){this.academy_user_id=this.route.snapshot.paramMap.get("academy_user_id"),this.loadInit()}loadInit(a=0,f=!1){(!this.utilsService.loadingPage||f)&&(this.utilsService.loadingPage=!0,setTimeout(()=>new Promise((g,j)=>{this.utilsService.presentLoading(this.translateService.instant("all.loading")).then(()=>{Promise.all([this.getAcademyUser()]).then(()=>{this.utilsService.closeAllAlerts(),this.utilsService.loadingPage=!1,g(!1)}).catch(C=>{this.utilsService.closeAllAlerts(),this.utilsService.loadingPage=!1,console.log("Error loadInit AcademyPage",C),j(C)})})}),a))}getAcademyUser(){var a=this;this.academyUser=null,this.academyService.getFromAcademyUser(this.academy_user_id).then(function(){var f=(0,F.A)(function*(g){a.academyUser=g});return function(g){return f.apply(this,arguments)}}(),f=>{console.log("error getAcademyUser: ",f)})}static#e=this.\u0275fac=function(f){return new(f||c)(e.rXU(R.nX),e.rXU(T.T),e.rXU(E.c$),e.rXU(I.k))};static#t=this.\u0275cmp=e.VBU({type:c,selectors:[["app-academy-user-profile"]],decls:7,vars:4,consts:[[1,"ion-no-border"],["defaultHref","/academy","slot","start"],[4,"ngIf"],[3,"academyUser","uploadPhoto"],[2,"margin-top","10px",3,"value"],[1,"h-214","card_container"],["value","first"],["slot","header","color","medium-shade",1,"title"],["name","person-outline",2,"margin-right","10px"],["slot","content"],["lines","full"],["slot","start",1,"data-title","smaller-text"],[1,"smaller-text"],["value","second"],["name","people-outline",2,"margin-right","10px"],["value","third"],["name","call-outline",2,"margin-right","10px"],["class","h-214 card_container",4,"ngIf"],["value","fourth"],["name","medkit-outline",2,"margin-right","10px"],["value","fifth"],["name","football-outline",2,"margin-right","10px"],["lines","full",4,"ngIf"],["value","sixth"],["name","shirt-outline",2,"margin-right","10px"]],template:function(f,g){1&f&&(e.j41(0,"ion-header",0)(1,"ion-toolbar"),e.nrm(2,"ion-back-button",1),e.j41(3,"ion-title"),e.EFF(4),e.nI1(5,"translate"),e.k0s()()(),e.DNE(6,p,85,52,"ion-content",2)),2&f&&(e.R7$(4),e.JRh(e.bMT(5,2,"ACADEMY_ACTIONS_BUTTONS.STUDENT_PROFILE")),e.R7$(2),e.Y8G("ngIf",g.academyUser))},dependencies:[u.bT,_.xk,_.YH,_.el,_.b_,_.W9,_.eU,_.iq,_.uz,_.he,_.BC,_.ai,_.tY,v.D,E.D9],styles:[".title[_ngcontent-%COMP%]{background:rgb(235,235,235);color:gray}.data-title[_ngcontent-%COMP%]{font-weight:700}.smaller-text[_ngcontent-%COMP%]{font-size:smaller}"]})}return c})()}];let P=(()=>{class c{static#e=this.\u0275fac=function(f){return new(f||c)};static#t=this.\u0275mod=e.$C({type:c});static#a=this.\u0275inj=e.G2t({imports:[R.iI.forChild(y),R.iI]})}return c})();var O=l(55553);let S=(()=>{class c{static#e=this.\u0275fac=function(f){return new(f||c)};static#t=this.\u0275mod=e.$C({type:c});static#a=this.\u0275inj=e.G2t({imports:[u.MD,t.YN,_.bv,P,E.h,O.h]})}return c})()},41808:(M,U,l)=>{l.d(U,{I:()=>A});var u=l(73308),t=l(22126),_=function(d){return d.Prompt="PROMPT",d.Camera="CAMERA",d.Photos="PHOTOS",d}(_||{}),R=function(d){return d.Rear="REAR",d.Front="FRONT",d}(R||{}),F=function(d){return d.Uri="uri",d.Base64="base64",d.DataUrl="dataUrl",d}(F||{});class e extends t.E_{getPhoto(o){var i=this;return(0,u.A)(function*(){return new Promise(function(){var n=(0,u.A)(function*(r,s){if(o.webUseInput||o.source===_.Photos)i.fileInputExperience(o,r,s);else if(o.source===_.Prompt){let m=document.querySelector("pwa-action-sheet");m||(m=document.createElement("pwa-action-sheet"),document.body.appendChild(m)),m.header=o.promptLabelHeader||"Photo",m.cancelable=!1,m.options=[{title:o.promptLabelPhoto||"From Photos"},{title:o.promptLabelPicture||"Take Picture"}],m.addEventListener("onSelection",function(){var p=(0,u.A)(function*(h){0===h.detail?i.fileInputExperience(o,r,s):i.cameraExperience(o,r,s)});return function(h){return p.apply(this,arguments)}}())}else i.cameraExperience(o,r,s)});return function(r,s){return n.apply(this,arguments)}}())})()}pickImages(o){var i=this;return(0,u.A)(function*(){return new Promise(function(){var n=(0,u.A)(function*(r,s){i.multipleFileInputExperience(r,s)});return function(r,s){return n.apply(this,arguments)}}())})()}cameraExperience(o,i,n){var r=this;return(0,u.A)(function*(){if(customElements.get("pwa-camera-modal")){const s=document.createElement("pwa-camera-modal");s.facingMode=o.direction===R.Front?"user":"environment",document.body.appendChild(s);try{yield s.componentOnReady(),s.addEventListener("onPhoto",function(){var m=(0,u.A)(function*(p){const h=p.detail;null===h?n(new t.I9("User cancelled photos app")):h instanceof Error?n(h):i(yield r._getCameraPhoto(h,o)),s.dismiss(),document.body.removeChild(s)});return function(p){return m.apply(this,arguments)}}()),s.present()}catch{r.fileInputExperience(o,i,n)}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),r.fileInputExperience(o,i,n)})()}fileInputExperience(o,i,n){let r=document.querySelector("#_capacitor-camera-input");const s=()=>{var m;null===(m=r.parentNode)||void 0===m||m.removeChild(r)};r||(r=document.createElement("input"),r.id="_capacitor-camera-input",r.type="file",r.hidden=!0,document.body.appendChild(r),r.addEventListener("change",m=>{const p=r.files[0];let h="jpeg";if("image/png"===p.type?h="png":"image/gif"===p.type&&(h="gif"),"dataUrl"===o.resultType||"base64"===o.resultType){const y=new FileReader;y.addEventListener("load",()=>{if("dataUrl"===o.resultType)i({dataUrl:y.result,format:h});else if("base64"===o.resultType){const P=y.result.split(",")[1];i({base64String:P,format:h})}s()}),y.readAsDataURL(p)}else i({webPath:URL.createObjectURL(p),format:h}),s()}),r.addEventListener("cancel",m=>{n(new t.I9("User cancelled photos app")),s()})),r.accept="image/*",r.capture=!0,o.source===_.Photos||o.source===_.Prompt?r.removeAttribute("capture"):o.direction===R.Front?r.capture="user":o.direction===R.Rear&&(r.capture="environment"),r.click()}multipleFileInputExperience(o,i){let n=document.querySelector("#_capacitor-camera-input-multiple");const r=()=>{var s;null===(s=n.parentNode)||void 0===s||s.removeChild(n)};n||(n=document.createElement("input"),n.id="_capacitor-camera-input-multiple",n.type="file",n.hidden=!0,n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",s=>{const m=[];for(let p=0;p<n.files.length;p++){const h=n.files[p];let y="jpeg";"image/png"===h.type?y="png":"image/gif"===h.type&&(y="gif"),m.push({webPath:URL.createObjectURL(h),format:y})}o({photos:m}),r()}),n.addEventListener("cancel",s=>{i(new t.I9("User cancelled photos app")),r()})),n.accept="image/*",n.click()}_getCameraPhoto(o,i){return new Promise((n,r)=>{const s=new FileReader,m=o.type.split("/")[1];"uri"===i.resultType?n({webPath:URL.createObjectURL(o),format:m,saved:!1}):(s.readAsDataURL(o),s.onloadend=()=>{const p=s.result;n("dataUrl"===i.resultType?{dataUrl:p,format:m,saved:!1}:{base64String:p.split(",")[1],format:m,saved:!1})},s.onerror=p=>{r(p)})})}checkPermissions(){var o=this;return(0,u.A)(function*(){if(typeof navigator>"u"||!navigator.permissions)throw o.unavailable("Permissions API not available in this browser");try{return{camera:(yield window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw o.unavailable("Camera permissions are not available in this browser")}})()}requestPermissions(){var o=this;return(0,u.A)(function*(){throw o.unimplemented("Not implemented on web.")})()}pickLimitedLibraryPhotos(){var o=this;return(0,u.A)(function*(){throw o.unavailable("Not implemented on web.")})()}getLimitedLibraryPhotos(){var o=this;return(0,u.A)(function*(){throw o.unavailable("Not implemented on web.")})()}}new e;const E=(0,t.F3)("Camera",{web:()=>new e});var I=l(2978),v=l(77897),x=l(22882);let A=(()=>{class d{constructor(i,n){this.actionSheetCtrl=i,this.translateService=n}actionSheetImage(i){var n=this;return(0,u.A)(function*(){return new Promise(function(){var r=(0,u.A)(function*(s,m){if(t.Ii.isNativePlatform()){const y=yield E.requestPermissions();if("denied"===y.photos||"denied"===y.camera)return;var p={quality:90,targetWidth:600,targetHeight:600,saveToPhotoAlbum:!1,correctOrientation:!0,cameraDirection:1,resultType:F.Base64,promptLabelHeader:n.translateService.instant("TITLE_ACTION_SHEET"),promptLabelPhoto:n.translateService.instant("TEXT2_ACTION_SHEET"),promptLabelPicture:n.translateService.instant("TEXT1_ACTION_SHEET")},h=yield E.getPhoto(p);s("data:image/"+h.format+";base64,"+h.base64String)}else i.click(),i.addEventListener("change",function(y){const P=y.target;if(P.files&&P.files.length>0){const O=P.files[0],S=new FileReader;S.onload=()=>{s(S.result)},S.readAsDataURL(O)}})});return function(s,m){return r.apply(this,arguments)}}())})()}static#e=this.\u0275fac=function(n){return new(n||d)(I.KVO(v.GD),I.KVO(x.c$))};static#t=this.\u0275prov=I.jDH({token:d,factory:d.\u0275fac,providedIn:"root"})}return d})()}}]);