File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/1737.658577efa4f34cc7.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1737],{81737:(I,b,o)=>{o.r(b),o.d(b,{MembershipDetailPageModule:()=>$});var m=o(56610),g=o(37222),a=o(77897),h=o(36075),v=o(73308),e=o(2978),M=o(7438),n=o(57291),c=o(3366);let d=(()=>{class s{constructor(t,i){this.storageService=t,this.apiService=i}getDeliveryPrice(t){var i=this;return(0,v.A)(function*(){return i.apiService.get(`memberships/${t}/delivery-price`)})()}static#e=this.\u0275fac=function(i){return new(i||s)(e.KVO(n.n),e.KVO(c.G))};static#t=this.\u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var u=o(69942),p=o(29885),_=o(46868),P=o(86962);function R(s,f){if(1&s&&(e.j41(0,"ion-col",3),e.EFF(1),e.k0s()),2&s){const t=e.XpG();e.R7$(1),e.JRh(t.addressUserLastUsed.direction)}}function y(s,f){if(1&s&&(e.j41(0,"ion-col",3),e.EFF(1),e.k0s()),2&s){const t=e.XpG();e.R7$(1),e.JRh(t.addressUserLastUsed.district)}}let D=(()=>{class s{constructor(t,i,r,l){this.router=t,this.userService=i,this.cartService=r,this.addressProvider=l,this.infoConfirmOrder={address:"",wayPay:"",cellphone:"",observations:"",point_sale_id:""}}ngOnInit(){this.getInfoAddressLastUsed()}ionViewWillEnter(){this.getInfoAddressLastUsed()}addNewAddress(){this.router.navigate(["/user-locations"])}getInfoAddressLastUsed(){this.userService.getInfoUser().then(t=>{console.log(t),this.listAddressUser=t.addresses,this.addressUserLastUsed=this.listAddressUser.find(i=>1===i.last_used),this.infoConfirmOrder.address=this.addressUserLastUsed.id})}changeAddress(t){for(let i=0;i<this.listAddressUser.length;i++)this.listAddressUser[i].id===t&&(this.addressUserLastUsed=this.listAddressUser[i],this.cartService.updateAddressPrice(this.addressUserLastUsed))}setLocation(t){this.location=t}static#e=this.\u0275fac=function(i){return new(i||s)(e.rXU(h.Ix),e.rXU(p.D),e.rXU(_.m),e.rXU(P.E))};static#t=this.\u0275cmp=e.VBU({type:s,selectors:[["app-address-form"]],decls:7,vars:2,consts:[["lines","none"],["size","12",4,"ngIf"],["size","small","expand","block",3,"click"],["size","12"]],template:function(i,r){1&i&&(e.j41(0,"div")(1,"ion-row",0),e.DNE(2,R,2,1,"ion-col",1),e.k0s(),e.j41(3,"ion-row",0),e.DNE(4,y,2,1,"ion-col",1),e.k0s(),e.j41(5,"ion-button",2),e.bIt("click",function(){return r.addNewAddress()}),e.EFF(6,"Cambiar ubicaci\xf3n"),e.k0s()()),2&i&&(e.R7$(2),e.Y8G("ngIf",r.addressUserLastUsed),e.R7$(2),e.Y8G("ngIf",r.addressUserLastUsed))},dependencies:[m.bT,a.Jm,a.hU,a.ln]})}return s})();var E=o(22882),U=o(60822);const F=["termCons"];function T(s,f){if(1&s&&(e.j41(0,"div",13)(1,"p")(2,"b"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"p"),e.EFF(6),e.k0s()()),2&s){const t=e.XpG();e.R7$(3),e.JRh(e.bMT(4,2,"MEMBERSHIP.DETAIL.DESCRIPTION")),e.R7$(3),e.JRh(t.membership.description)}}function A(s,f){if(1&s&&(e.j41(0,"div",13)(1,"p")(2,"b"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"formatCurrency"),e.k0s()()),2&s){const t=e.XpG();e.R7$(3),e.JRh(e.bMT(4,2,"MEMBERSHIP.DETAIL.PRICE")),e.R7$(3),e.JRh(e.i5U(7,4,t.membership.price,t.currency))}}function S(s,f){if(1&s&&(e.j41(0,"div",13)(1,"p")(2,"b"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"p"),e.EFF(6),e.k0s()()),2&s){const t=e.XpG();e.R7$(3),e.JRh(e.bMT(4,2,"MEMBERSHIP.DETAIL.CONDITIONS")),e.R7$(3),e.JRh(t.membership.conditions)}}function O(s,f){if(1&s&&(e.j41(0,"ion-row")(1,"ion-col",14)(2,"p"),e.EFF(3),e.nI1(4,"formatCurrency"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.k0s(),e.nrm(7,"app-address-form"),e.k0s()()),2&s){const t=e.XpG();e.R7$(3),e.Lme("",t.membership.terms_text," ",e.i5U(4,3,t.deliveryPrice.price,t.currency),""),e.R7$(3),e.JRh(t.membership.terms_confirm)}}const j=[{path:"",component:(()=>{class s{constructor(t,i,r,l,C){this.activatedRoute=t,this.membershipService=i,this.router=r,this.servientregaService=l,this.corporateIdentityService=C,this.membership={id:0,name:"",description:"",price:0,action:"",conditions:"",terms_and_conditions:"",terms_text:"",terms_confirm:""},this.acceptTermCons=!1,this.currency=this.corporateIdentityService.getCurrency()}ngOnInit(){}ionViewWillEnter(){this.acceptTermCons=!1,this.termCons.checked=!1,this.id=this.activatedRoute.snapshot.paramMap.get("membershipId"),this.getMembership(this.id)}getMembership(t){var i=this;return(0,v.A)(function*(){(yield i.membershipService.getMembership(t)).subscribe(r=>{i.membership=r.data},r=>{console.error("error getMembership: ",r)}),(yield i.servientregaService.getDeliveryPrice(t)).subscribe(r=>{i.deliveryPrice=r.data},r=>{console.error("error getting delivery price: ",r)})})()}termConsEvent(t){this.acceptTermCons=!t.currentTarget.checked}goPayment(t){var i=this;return(0,v.A)(function*(){i.acceptTermCons&&(yield i.membershipService.membershipSubscribe(t)).subscribe(r=>{i.router.navigate(["/payment-gateway-selection"],{state:{membershipId:r.id}})},r=>{console.error("error goPayment: ",r)})})()}static#e=this.\u0275fac=function(i){return new(i||s)(e.rXU(h.nX),e.rXU(M.C),e.rXU(h.Ix),e.rXU(d),e.rXU(u.r))};static#t=this.\u0275cmp=e.VBU({type:s,selectors:[["app-membership-detail"]],viewQuery:function(i,r){if(1&i&&e.GBs(F,5),2&i){let l;e.mGM(l=e.lsd())&&(r.termCons=l.first)}},decls:30,vars:16,consts:[[1,"ion-no-border"],["slot","start"],[1,"ion-text-center"],["name","star-outline",1,"icon-title"],[1,"text-title"],["class","paragraph",4,"ngIf"],["lines","none"],["target","_blank",3,"href"],["slot","start","value","true",3,"click"],["termCons",""],[4,"ngIf"],[1,"ion-justify-content-end"],["size","small",3,"disabled","click"],[1,"paragraph"],["size","12"]],template:function(i,r){1&i&&(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")(7,"ion-card")(8,"ion-card-header")(9,"ion-card-title"),e.nrm(10,"ion-icon",3),e.j41(11,"p",4),e.EFF(12),e.k0s()()(),e.j41(13,"ion-card-content"),e.DNE(14,T,7,4,"div",5),e.DNE(15,A,8,7,"div",5),e.DNE(16,S,7,4,"div",5),e.j41(17,"ion-item",6)(18,"ion-label")(19,"p")(20,"a",7),e.EFF(21),e.nI1(22,"translate"),e.k0s()()(),e.j41(23,"ion-checkbox",8,9),e.bIt("click",function(C){return r.termConsEvent(C)}),e.k0s()(),e.DNE(25,O,8,6,"ion-row",10),e.j41(26,"ion-row",11)(27,"ion-button",12),e.bIt("click",function(){return r.goPayment(r.membership.id)}),e.EFF(28),e.nI1(29,"translate"),e.k0s()()()()()),2&i&&(e.R7$(4),e.JRh(e.bMT(5,10,"MEMBERSHIP.DETAIL.TITLE")),e.R7$(8),e.JRh(r.membership.name),e.R7$(2),e.Y8G("ngIf",r.membership.description),e.R7$(1),e.Y8G("ngIf",r.membership.price),e.R7$(1),e.Y8G("ngIf",r.membership.conditions),e.R7$(4),e.FS9("href",r.membership.terms_and_conditions,e.B4B),e.R7$(1),e.SpI(" ",e.bMT(22,12,"MEMBERSHIP.DETAIL.TERMS_AND_CONDITIONS"),""),e.R7$(4),e.Y8G("ngIf",r.acceptTermCons),e.R7$(2),e.Y8G("disabled",!r.acceptTermCons),e.R7$(1),e.SpI(" ",e.bMT(29,14,"MEMBERSHIP.DETAIL.SUBSCRIBE"),""))},dependencies:[m.bT,a.el,a.Jm,a.b_,a.I9,a.ME,a.tN,a.eY,a.hU,a.W9,a.eU,a.iq,a.uz,a.he,a.ln,a.BC,a.ai,a.hB,a.tY,D,E.D9,U.P],styles:["ion-content[_ngcontent-%COMP%]{--background: #f9f9f9 !important}ion-card[_ngcontent-%COMP%]{box-shadow:0 1px 6px gray;margin-top:15px;margin-bottom:15px;border-radius:10px}ion-card-title[_ngcontent-%COMP%]{display:flex;font-size:large;color:var(--color-title);font-weight:700}ion-card-content[_ngcontent-%COMP%]{padding-bottom:5px}ion-segment-button[_ngcontent-%COMP%]{--ripple-color: transparent !important;--ripple-duration: 0ms !important}td[_ngcontent-%COMP%]{vertical-align:top}.content[_ngcontent-%COMP%]{height:100%}.text-title[_ngcontent-%COMP%]{width:100%}.icon-title[_ngcontent-%COMP%]{margin-right:5px}.paragraph[_ngcontent-%COMP%]{display:flex;flex-flow:column;margin-bottom:15px}.paragraph[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}"]})}return s})()}];let L=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.$C({type:s});static#s=this.\u0275inj=e.G2t({imports:[h.iI.forChild(j),h.iI]})}return s})();var x=o(41683);let $=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=e.$C({type:s});static#s=this.\u0275inj=e.G2t({imports:[m.MD,g.YN,a.bv,L,E.h,x.Y]})}return s})()},86962:(I,b,o)=>{o.d(b,{E:()=>v});var m=o(73308),g=o(2978),a=o(3366),h=o(54171);let v=(()=>{class e{constructor(n,c){this.api=n,this.utilsService=c,this._allCitiesService=[],this._allDepartments=[]}getAllCitiesService(){var n=this;return(0,m.A)(function*(){(yield n.api.getFree("address/allCitiesService")).subscribe(d=>{"success"==d.status&&(n._allCitiesService=d.citiesService,n._pointCoverage=d.pointCoverage.point_coverage)},d=>{console.error("Error provider address getAllCitiesService",d)})})()}getAllDepartments(){var n=this;return(0,m.A)(function*(){return new Promise(function(){var c=(0,m.A)(function*(d,u){(yield n.api.getFree("address/allDepartments")).subscribe(p=>{"success"==p.status&&(n._allDepartments=p.departments),d(p)},p=>{console.error("Error provider address getAllDepartments",p),u(p)})});return function(d,u){return c.apply(this,arguments)}}())})()}getAllCities(n){return this.api.getFree("address/allCities/"+n)}getAllCitiesAdvisor(n){return this.api.getFree("address/allCities/"+n)}addAddressUser(n,c){return this.api.post("address/add",n,c)}deleteAddress(n,c){return this.api.post("address/delete",{address_id:n},c)}updateLocationAddress(n,c,d){return this.api.put("address/updateLocation",{address_id:n,lat:c.lat,lng:c.lng},d)}saveCoveragePending(n,c){return this.api.post("address/saveCoveragePending",n,c)}addresToLatLong(n,c){return this.api.get("address/geocode/"+encodeURIComponent(n),c)}static#e=this.\u0275fac=function(c){return new(c||e)(g.KVO(a.G),g.KVO(h.T))};static#t=this.\u0275prov=g.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})()}}]);