File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/3641.a7dd5ec425184152.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3641],{3641:(F,B,m)=>{m.r(B),m.d(B,{BusinessRegisterPageModule:()=>j});var p=m(56610),P=m(37222),h=m(77897),y=m(36075),x=m(73308),R=m(88915),e=m(2978),o=m(73012),a=m(54171),f=m(22882),E=m(86962),v=m(41808),c=m(7125),n=m(26811);function g(l,A){1&l&&e.nrm(0,"img",41)}function u(l,A){if(1&l&&e.nrm(0,"img",42),2&l){const i=e.XpG();e.FS9("src",i.business.image,e.B4B)}}function d(l,A){if(1&l&&e.nrm(0,"img",43),2&l){const i=e.XpG();e.FCK("src","",i.cityProvider._urlGallery,"business/",i.business.image,"",e.B4B)}}function _(l,A){1&l&&e.nrm(0,"ion-icon",44)}function T(l,A){1&l&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&l&&(e.R7$(1),e.JRh(e.bMT(2,1,"BUSINESS_NAME_REQUIRED")))}function I(l,A){if(1&l&&(e.j41(0,"div",45),e.DNE(1,T,3,3,"div",46),e.k0s()),2&l){const i=e.XpG(),s=e.sdS(20);e.R7$(1),e.Y8G("ngIf",i.statusInvalidName||(null==s.errors?null:s.errors.required))}}function S(l,A){1&l&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&l&&(e.R7$(1),e.SpI("",e.bMT(2,1,"DESCRIPTION_REQUIRED")," "))}function M(l,A){if(1&l&&(e.j41(0,"div",45),e.DNE(1,S,3,3,"div",46),e.k0s()),2&l){const i=e.XpG(),s=e.sdS(25);e.R7$(1),e.Y8G("ngIf",i.statusInvalidDescription||(null==s.errors?null:s.errors.required))}}function k(l,A){1&l&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&l&&(e.R7$(1),e.JRh(e.bMT(2,1,"PHONE_REQUIRED")))}function U(l,A){if(1&l&&(e.j41(0,"div",45),e.DNE(1,k,3,3,"div",46),e.k0s()),2&l){const i=e.XpG(),s=e.sdS(30);e.R7$(1),e.Y8G("ngIf",i.statusInvalidPhone||(null==s.errors?null:s.errors.required))}}function L(l,A){if(1&l&&(e.j41(0,"ion-select-option",47),e.EFF(1),e.k0s()),2&l){const i=A.$implicit;e.Y8G("value",i.id),e.R7$(1),e.SpI(" ",i.name," ")}}function D(l,A){if(1&l){const i=e.RV6();e.j41(0,"div",36)(1,"ion-checkbox",48),e.bIt("ngModelChange",function(t){e.eBV(i);const C=e.XpG();return e.Njj(C.terms=t)}),e.k0s(),e.j41(2,"span",38),e.EFF(3),e.nI1(4,"translate"),e.j41(5,"span",49),e.bIt("click",function(){e.eBV(i);const t=e.XpG();return e.Njj(t.openTermsSI())}),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()}if(2&l){const i=e.XpG();e.R7$(1),e.Y8G("ngModel",i.terms),e.R7$(2),e.SpI("",e.bMT(4,3,"TERMS_AND_CONDITIONS_1")," "),e.R7$(3),e.JRh(e.bMT(7,5,"TERMS_AND_CONDITIONS_2"))}}const w=[{path:"",component:(()=>{class l{constructor(i,s,t,C,b,r,$,X,Y,H,K,V,W){this.businessService=i,this.utilsService=s,this.location=t,this.actionSheetCtrl=C,this.translateService=b,this.addressService=r,this.route=$,this.alertCtrl=X,this.modalCtrl=Y,this.routerOutlet=H,this.photoService=K,this.navCtrl=V,this.cityProvider=W,this.statusInvalidName=!1,this.statusInvalidDescription=!1,this.statusInvalidPhone=!1,this.statusInvalidAddress=!1,this.statusInvalidAge=!1,this.terms=!1,this.titleText=this.translateService.instant("BUSINESS_REGISTER_TITLE"),this.buttonText=this.translateService.instant("SIGNUP_BUTTON"),this.parameters=[],this.business={id:null,name:null,category_id:null,age:null,address:{direction:null,long:null,lat:null},facebook:null,instagram:null,phone:null,description:null,image:null,website:null},this.showTerms=!1,this.businessLocation=null,this.businessAddressMap=null,this.loaded=!1,this.translateService.get(["PROFILE_UPDATED","TITLE_ACTION_SHEET","TEXT1_ACTION_SHEET","TEXT2_ACTION_SHEET","TEXT_CANCEL_SELECT","TEXT1_UPDATE_IMAGE_PROFILE","TEXT2_UPDATE_IMAGE_PROFILE","TEXT3_UPDATE_IMAGE_PROFILE","TEXT4_UPDATE_IMAGE_PROFILE"]).subscribe(O=>{this.messageText={updateSuccess:O.PROFILE_UPDATED,titleAction:O.TITLE_ACTION_SHEET,photo:O.TEXT1_ACTION_SHEET,gallery:O.TEXT2_ACTION_SHEET,cancel:O.TEXT_CANCEL_SELECT,text1UpdateImage:O.TEXT1_UPDATE_IMAGE_PROFILE,text2UpdateImage:O.TEXT2_UPDATE_IMAGE_PROFILE,text3UpdateImage:O.TEXT3_UPDATE_IMAGE_PROFILE,text4UpdateImage:O.TEXT4_UPDATE_IMAGE_PROFILE}}),this.businessId=this.route.snapshot.paramMap.get("business"),this.categoryId=this.route.snapshot.paramMap.get("category")}ngOnInit(){var i=this;return(0,x.A)(function*(){i.loadInit(100)})()}loadInit(i=0){setTimeout(()=>new Promise((s,t)=>{Promise.all([this.businessService.getParameters().then(C=>{this.parameters=C}),this.businessService.getCategories(!0).then(()=>{this.getBusiness()})]).then(()=>{this.utilsService.dismissLoading(),s(!1)}).catch(C=>{this.utilsService.dismissLoading(),console.log("Error loadInit BusinessRegisterPage",C),t(C)})}),i)}getParameterValue(i){let s=this.parameters.filter(t=>t.key===i)[0];return s?s.value:""}getBusiness(){if(!this.businessId||0==this.businessId)return this.categoryId&&(this.business.category_id=Number(this.categoryId)),void(this.showTerms=!0);this.titleText=this.translateService.instant("BUSINESS_UPDATE_TITLE"),this.buttonText=this.translateService.instant("UPDATE"),this.business=this.businessService.businesses.find(i=>i.id===Number(this.businessId)),this.business&&(this.business.address.lng=this.business.address.long,this.business.address.lat=this.business.address.lat,this.business.address.address=this.business.address.direction,this.businessLocation=this.business.address)}avoidSpecialChars(i){let s=!1,t=String.fromCharCode(i.charCode?i.charCode:i.which);switch(i.target.type){case"text":if(s=/^[0-9a-zA-Z\xf1\xe1\xe9\xed\xf3\xfa\xfc ]+$/i.test(t),s)return!0;break;case"email":if(s=/^[0-9a-zA-Z\xf1\xe1\xe9\xed\xf3\xfa\xfc@.!#$%&'*/=?^_+-`{|}~]+$/i.test(t),s)return!0;break;case"tel":if(s=/^[0-9]+$/i.test(t),s)return!0}return i.preventDefault(),!1}clearSpecialChars(i){let s=!1;switch(i.type){case"text":s=/^[0-9a-zA-Z\xf1\xe1\xe9\xed\xf3\xfa\xfc ]+$/i.test(i.value),s||(i.value=i.value.replace(/[^0-9a-zA-Z\xf1\xe1\xe9\xed\xf3\xfa\xfc ]+/g,"").trim());break;case"email":s=/^[0-9a-zA-Z\xf1\xe1\xe9\xed\xf3\xfa\xfc@.!#$%&'*/=?^_+-`{|}~]+$/i.test(i.value),s&&(i.value=i.value.replace(/[^0-9a-zA-Z\xf1\xe1\xe9\xed\xf3\xfa\xfc@.!#$%&'*/=?^_+-`{|}~]+/g,"").trim());break;case"tel":s=/^[0-9]+$/i.test(i.value),s&&(i.value=i.value.replace(/[^0-9]+/g,"").trim())}}actionSheetImage(i){var s=this;return(0,x.A)(function*(){s.photoService.actionSheetImage(i).then(t=>{s.image=t,s.business.image=t})})()}register(i){var s=i.value;s.image=this.image,s.id=this.business.id,this.businessLocation&&(s.businessLatitude=this.businessLocation.lat,s.businessLongitude=this.businessLocation.lng,s.businessCoverage_id=this.businessLocation,s.businessAddress=this.businessLocation.address),s.age?s.category?this.businessLocation?s.terms||this.business.id?(this.utilsService.presentLoading(this.translateService.instant("all.loading")),this.businessService.registerBusiness(s).then(t=>{this.utilsService.dismissLoading(),t.r?this.confirmBusinessRegistration(t):this.utilsService.presentToast(4e3,"tertiary","top",t.m)}).catch(t=>{this.utilsService.dismissLoading(),this.utilsService.presentToast(4e3,"danger","top",this.translateService.instant("all.error_request"))})):this.utilsService.presentToast(3e3,"warning","top",this.translateService.instant("TERMS_REQUIRED")):this.utilsService.presentToast(3e3,"warning","top",this.translateService.instant("ADDRESS_REQUIRED")):this.utilsService.presentToast(3e3,"warning","top",this.translateService.instant("CATEGORY_REQUIRED")):this.utilsService.presentToast(3e3,"warning","top",this.translateService.instant("AGE_REQUIRED"))}openTermsSI(){let i=this.getParameterValue("terms");this.utilsService.openLink(i)}confirmBusinessRegistration(i){var s=this;return(0,x.A)(function*(){yield(yield s.alertCtrl.create({header:"Mensaje",message:i.m,buttons:[{text:"Ok",handler:()=>{s.businessService.userHaveBusiness=!0,s.close(),s.location.back()}}]})).present()})()}close(){this.businessService.getCategories(!1)}showLocationModal(i){var s=this;return(0,x.A)(function*(){if(i.currentTarget.checked){const t=yield s.modalCtrl.create({component:R.t,swipeToClose:!0,presentingElement:s.routerOutlet.nativeEl});t.onDidDismiss().then(C=>{s.currentLocation=C.data}),yield t.present()}})()}setBusinessLocation(i){""!=i.address&&(this.businessLocation=i)}onPaste(i){}static#e=this.\u0275fac=function(s){return new(s||l)(e.rXU(o.u),e.rXU(a.T),e.rXU(p.aZ),e.rXU(h.GD),e.rXU(f.c$),e.rXU(E.E),e.rXU(y.nX),e.rXU(h.hG),e.rXU(h.W3),e.rXU(h.Rg),e.rXU(v.I),e.rXU(h.q9),e.rXU(c.h))};static#t=this.\u0275cmp=e.VBU({type:l,selectors:[["app-business-register"]],decls:76,vars:62,consts:[[1,"ion-no-border"],["slot","start"],[3,"click"],[1,"ion-padding"],[1,"item","ion-text-center",3,"click"],["type","file","accept","image/*",2,"display","none"],["fileInput",""],["src","../../assets/img/business.png","class","imageUserProfile",4,"ngIf"],["class","businessImage",3,"src",4,"ngIf"],["class","businessImage","onerror","if (this.src != 'error.jpg') this.src = '../../assets/img/default.png';",3,"src",4,"ngIf"],["class","ion-no-margin notify-badge","name","camera",4,"ngIf"],["ngNativeValidate","",3,"ngSubmit"],["formRegister","ngForm"],["lines","none",1,"ion-margin-top","inputBorderRadius"],["type","text","ngModel","","name","name","required","","maxlength","191",1,"ion-text-center",3,"placeholder","ngModel","change","input","keypress","paste","ngModelChange"],["name","ngModel"],["class","ion-text-center inputRequired",4,"ngIf"],["type","text","ngModel","","name","description","required","","maxlength","191",1,"ion-text-center",3,"placeholder","ngModel","change","input","keypress","paste","ngModelChange"],["description","ngModel"],["type","tel","ngModel","","name","phone","required","","maxlength","191",1,"ion-text-center",3,"placeholder","ngModel","change","input","keypress","paste","ngModelChange"],["phone","ngModel"],["type","text","ngModel","","name","business_instagram","maxlength","191",1,"ion-text-center",3,"placeholder","ngModel","paste","ngModelChange"],["business_instagram","ngModel"],["type","text","ngModel","","name","business_facebook","maxlength","191",1,"ion-text-center",3,"placeholder","ngModel","paste","ngModelChange"],["business_facebook","ngModel"],["type","text","ngModel","","name","website","maxlength","191",1,"ion-text-center",3,"placeholder","ngModel","paste","ngModelChange"],["website","ngModel"],["interface","popover","name","age","required","",1,"ion-text-center","placeholder-select",3,"placeholder","ngModel","okText","cancelText","ngModelChange"],["value","0-2"],["value","2-5"],["value","5+"],["interface","popover","name","category","aria-required","required",1,"ion-text-center","placeholder-select",3,"placeholder","ngModel","okText","cancelText","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["position","stacked",1,"form-field-label"],["lines","none",1,"inputBorderRadius","ion-margin-top"],[2,"height","30vh","display","block","width","100%",3,"showSearchField","location"],[1,"ion-margin","p-r"],["color","primary","name","locationCheck","checked","false",3,"ionChange"],[1,"text_terms"],["class","ion-margin p-r",4,"ngIf"],["type","submit","color","primary","shape","round","expand","block","fill","solid",1,"marginTop10"],["src","../../assets/img/business.png",1,"imageUserProfile"],[1,"businessImage",3,"src"],["onerror","if (this.src != 'error.jpg') this.src = '../../assets/img/default.png';",1,"businessImage",3,"src"],["name","camera",1,"ion-no-margin","notify-badge"],[1,"ion-text-center","inputRequired"],[4,"ngIf"],[3,"value"],["color","primary","name","terms","checked","False",3,"ngModel","ngModelChange"],[1,"openTerms",3,"click"]],template:function(s,t){if(1&s){const C=e.RV6();e.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-buttons",1)(3,"ion-back-button",2),e.bIt("click",function(){return t.close()}),e.k0s()(),e.j41(4,"ion-title"),e.EFF(5),e.k0s()()(),e.j41(6,"ion-content",3)(7,"div",4),e.bIt("click",function(){e.eBV(C);const r=e.sdS(9);return e.Njj(t.actionSheetImage(r))}),e.nrm(8,"input",5,6),e.DNE(10,g,1,0,"img",7),e.DNE(11,u,1,1,"img",8),e.DNE(12,d,1,2,"img",9),e.j41(13,"span"),e.DNE(14,_,1,0,"ion-icon",10),e.k0s()(),e.j41(15,"form",11,12),e.bIt("ngSubmit",function(){e.eBV(C);const r=e.sdS(16);return e.Njj(t.register(r))}),e.j41(17,"ion-list")(18,"ion-item",13)(19,"ion-input",14,15),e.bIt("change",function(r){return t.clearSpecialChars(r.target)})("input",function(r){return t.avoidSpecialChars(r)})("keypress",function(r){return t.avoidSpecialChars(r)})("paste",function(r){return t.onPaste(r)})("ngModelChange",function(r){return t.business.name=r}),e.nI1(21,"translate"),e.k0s()(),e.DNE(22,I,2,1,"div",16),e.j41(23,"ion-item",13)(24,"ion-input",17,18),e.bIt("change",function(r){return t.clearSpecialChars(r.target)})("input",function(r){return t.avoidSpecialChars(r)})("keypress",function(r){return t.avoidSpecialChars(r)})("paste",function(r){return t.onPaste(r)})("ngModelChange",function(r){return t.business.description=r}),e.nI1(26,"translate"),e.k0s()(),e.DNE(27,M,2,1,"div",16),e.j41(28,"ion-item",13)(29,"ion-input",19,20),e.bIt("change",function(r){return t.clearSpecialChars(r.target)})("input",function(r){return t.avoidSpecialChars(r)})("keypress",function(r){return t.avoidSpecialChars(r)})("paste",function(r){return t.onPaste(r)})("ngModelChange",function(r){return t.business.phone=r}),e.nI1(31,"translate"),e.k0s()(),e.DNE(32,U,2,1,"div",16),e.j41(33,"ion-item",13)(34,"ion-input",21,22),e.bIt("paste",function(r){return t.onPaste(r)})("ngModelChange",function(r){return t.business.instagram=r}),e.nI1(36,"translate"),e.k0s()(),e.j41(37,"ion-item",13)(38,"ion-input",23,24),e.bIt("paste",function(r){return t.onPaste(r)})("ngModelChange",function(r){return t.business.facebook=r}),e.nI1(40,"translate"),e.k0s()(),e.j41(41,"ion-item",13)(42,"ion-input",25,26),e.bIt("paste",function(r){return t.onPaste(r)})("ngModelChange",function(r){return t.business.website=r}),e.nI1(44,"translate"),e.k0s()(),e.j41(45,"ion-item",13)(46,"ion-select",27),e.bIt("ngModelChange",function(r){return t.business.age=r}),e.nI1(47,"translate"),e.nI1(48,"translate"),e.nI1(49,"translate"),e.j41(50,"ion-select-option",28),e.EFF(51,"De 0 a 2 a\xf1os"),e.k0s(),e.j41(52,"ion-select-option",29),e.EFF(53,"De 2 a 5 a\xf1os"),e.k0s(),e.j41(54,"ion-select-option",30),e.EFF(55,"M\xe1s de 5 a\xf1os"),e.k0s()()(),e.j41(56,"ion-item",13)(57,"ion-select",31),e.bIt("ngModelChange",function(r){return t.business.category_id=r}),e.nI1(58,"translate"),e.nI1(59,"translate"),e.nI1(60,"translate"),e.DNE(61,L,2,2,"ion-select-option",32),e.k0s()(),e.j41(62,"ion-label",33),e.EFF(63),e.nI1(64,"translate"),e.k0s(),e.j41(65,"ion-item",34)(66,"app-map",35),e.bIt("location",function(r){return t.setBusinessLocation(r)}),e.k0s()(),e.j41(67,"div",36)(68,"ion-checkbox",37),e.bIt("ionChange",function(r){return t.showLocationModal(r)}),e.k0s(),e.j41(69,"span",38),e.EFF(70),e.nI1(71,"translate"),e.k0s()(),e.nrm(72,"br"),e.DNE(73,D,8,7,"div",39),e.j41(74,"ion-button",40),e.EFF(75),e.k0s()()()()}if(2&s){const C=e.sdS(20),b=e.sdS(25),r=e.sdS(30);e.R7$(5),e.JRh(t.titleText),e.R7$(5),e.Y8G("ngIf",!t.business.image),e.R7$(1),e.Y8G("ngIf",t.business.image&&t.business.image.includes("http")),e.R7$(1),e.Y8G("ngIf",t.business.image&&!t.business.image.includes("http")),e.R7$(2),e.Y8G("ngIf",t.business.image),e.R7$(5),e.FS9("placeholder",e.bMT(21,34,"BUSINESS_NAME")),e.Y8G("ngModel",t.business.name),e.R7$(3),e.Y8G("ngIf",C.invalid&&(C.dirty||C.touched)||t.statusInvalidName&&C.invalid),e.R7$(2),e.FS9("placeholder",e.bMT(26,36,"BUSINESS_DESCRIPTION")),e.Y8G("ngModel",t.business.description),e.R7$(3),e.Y8G("ngIf",b.invalid&&(b.dirty||b.touched)||t.statusInvalidDescription&&b.invalid),e.R7$(2),e.FS9("placeholder",e.bMT(31,38,"PHONE")),e.Y8G("ngModel",t.business.phone),e.R7$(3),e.Y8G("ngIf",r.invalid&&(r.dirty||r.touched)||t.statusInvalidPhone&&r.invalid),e.R7$(2),e.FS9("placeholder",e.bMT(36,40,"BUSINESS_INSTAGRAM")),e.Y8G("ngModel",t.business.instagram),e.R7$(4),e.FS9("placeholder",e.bMT(40,42,"BUSINESS_FACEBOOK")),e.Y8G("ngModel",t.business.facebook),e.R7$(4),e.FS9("placeholder",e.bMT(44,44,"WEBSITE")),e.Y8G("ngModel",t.business.website),e.R7$(4),e.FS9("placeholder",e.bMT(47,46,"AGE")),e.FS9("okText",e.bMT(48,48,"TEXT_OK_SELECT")),e.FS9("cancelText",e.bMT(49,50,"TEXT_CANCEL_SELECT")),e.Y8G("ngModel",t.business.age),e.R7$(11),e.FS9("placeholder",e.bMT(58,52,"CATEGORY")),e.FS9("okText",e.bMT(59,54,"TEXT_OK_SELECT")),e.FS9("cancelText",e.bMT(60,56,"TEXT_CANCEL_SELECT")),e.Y8G("ngModel",t.business.category_id),e.R7$(4),e.Y8G("ngForOf",t.businessService.categories),e.R7$(2),e.SpI(" ",e.bMT(64,58,"ADDRESS")," "),e.R7$(3),e.Y8G("showSearchField",!0),e.R7$(4),e.SpI("",e.bMT(71,60,"SHARE_LOCATION_TEXT")," "),e.R7$(3),e.Y8G("ngIf",t.showTerms),e.R7$(2),e.SpI(" ",t.buttonText," ")}},dependencies:[p.Sq,p.bT,P.BC,P.cb,P.YS,P.tU,P.vS,P.cV,h.el,h.Jm,h.QW,h.eY,h.W9,h.eU,h.iq,h.$w,h.uz,h.he,h.nf,h.Nm,h.Ip,h.BC,h.ai,h.hB,h.Je,h.Gw,h.tY,n.i,f.D9],styles:[".imageUserProfile[_ngcontent-%COMP%]{display:block!important;margin:10px auto!important;width:90px;height:90px;max-width:90px;max-height:90px}.textImageUserProfile[_ngcontent-%COMP%]{font-weight:700}.notEdit[_ngcontent-%COMP%]{pointer-events:none;opacity:.6}ion-content[_ngcontent-%COMP%]{--background: url(bg.42dc834307d6eb3a.png) 0 0 / cover no-repeat}.scroll-content[_ngcontent-%COMP%]{background-color:#fff}.imageAddress[_ngcontent-%COMP%]{display:block!important;margin:10px auto!important;width:100%;height:100px}.textTittleAddress[_ngcontent-%COMP%]{font-size:18px;color:var(--color-title);margin-top:20px;margin-bottom:25px}.select-text[_ngcontent-%COMP%] .typeTrackEdit[_ngcontent-%COMP%]{margin-right:10px!important;margin-left:-15px!important}.typeTrackEdit.select-ios[_ngcontent-%COMP%]{padding:11px 8px 16px 16px!important}.typeTrackEdit[_ngcontent-%COMP%]{width:auto!important;min-width:100%!important;border:1px solid var(--color-border-input-select)!important;border-radius:5px!important;height:46px!important}.ion-select[_ngcontent-%COMP%] .typeTrackEdit[_ngcontent-%COMP%]{max-width:100%!important}.itemEditTypeTrack[_ngcontent-%COMP%] .item-inner[_ngcontent-%COMP%]{border-bottom:none!important;max-width:100px!important}.marginLeft2[_ngcontent-%COMP%]{margin-left:2%}.widthCol20[_ngcontent-%COMP%]{width:20%!important;max-width:20%!important}.separatorsNumber[_ngcontent-%COMP%], .separatorsLined[_ngcontent-%COMP%]{padding:0 5px;margin-top:10px;font-size:20px}.itemEditNumberTrack1[_ngcontent-%COMP%]{border:1px solid var(--color-border-input-select)!important;border-radius:5px!important}.itemEditNumberTrack1[_ngcontent-%COMP%] .item-inner[_ngcontent-%COMP%]{border-bottom:none!important}.itemEditNumberTrack2[_ngcontent-%COMP%]{border:1px solid var(--color-border-input-select)!important;border-radius:5px!important}.itemEditNumberTrack2[_ngcontent-%COMP%] .item-inner[_ngcontent-%COMP%]{border-bottom:none!important}.itemEditNumberTrack3[_ngcontent-%COMP%]{border:1px solid var(--color-border-input-select)!important;border-radius:5px!important}.itemEditNumberTrack3[_ngcontent-%COMP%] .item-inner[_ngcontent-%COMP%]{border-bottom:none!important}ion-input.inputAddress[_ngcontent-%COMP%]{border:none!important}.placeholder-select[_ngcontent-%COMP%]{border:1px solid #dedede;width:-webkit-fill-available;border-radius:5px}.text_terms[_ngcontent-%COMP%]{top:0;position:absolute;left:30px}.openTerms[_ngcontent-%COMP%]{text-decoration:underline;color:var(--ion-color-primary)}.businessImage[_ngcontent-%COMP%]{box-shadow:1px 2px 2px 1px gray;border-radius:10px;width:100px;height:100px}.notify-badge[_ngcontent-%COMP%]{position:absolute;left:59vw;top:96px;text-align:center;border-radius:30px;padding:4px;font-size:20px;background:lightgray}"]})}return l})()}];let N=(()=>{class l{static#e=this.\u0275fac=function(s){return new(s||l)};static#t=this.\u0275mod=e.$C({type:l});static#n=this.\u0275inj=e.G2t({imports:[y.iI.forChild(w),y.iI]})}return l})();var G=m(55553);let j=(()=>{class l{static#e=this.\u0275fac=function(s){return new(s||l)};static#t=this.\u0275mod=e.$C({type:l});static#n=this.\u0275inj=e.G2t({imports:[p.MD,P.YN,h.bv,N,f.h.forChild(),G.h]})}return l})()},86962:(F,B,m)=>{m.d(B,{E:()=>x});var p=m(73308),P=m(2978),h=m(3366),y=m(54171);let x=(()=>{class R{constructor(o,a){this.api=o,this.utilsService=a,this._allCitiesService=[],this._allDepartments=[]}getAllCitiesService(){var o=this;return(0,p.A)(function*(){(yield o.api.getFree("address/allCitiesService")).subscribe(f=>{"success"==f.status&&(o._allCitiesService=f.citiesService,o._pointCoverage=f.pointCoverage.point_coverage)},f=>{console.error("Error provider address getAllCitiesService",f)})})()}getAllDepartments(){var o=this;return(0,p.A)(function*(){return new Promise(function(){var a=(0,p.A)(function*(f,E){(yield o.api.getFree("address/allDepartments")).subscribe(v=>{"success"==v.status&&(o._allDepartments=v.departments),f(v)},v=>{console.error("Error provider address getAllDepartments",v),E(v)})});return function(f,E){return a.apply(this,arguments)}}())})()}getAllCities(o){return this.api.getFree("address/allCities/"+o)}getAllCitiesAdvisor(o){return this.api.getFree("address/allCities/"+o)}addAddressUser(o,a){return this.api.post("address/add",o,a)}deleteAddress(o,a){return this.api.post("address/delete",{address_id:o},a)}updateLocationAddress(o,a,f){return this.api.put("address/updateLocation",{address_id:o,lat:a.lat,lng:a.lng},f)}saveCoveragePending(o,a){return this.api.post("address/saveCoveragePending",o,a)}addresToLatLong(o,a){return this.api.get("address/geocode/"+encodeURIComponent(o),a)}static#e=this.\u0275fac=function(a){return new(a||R)(P.KVO(h.G),P.KVO(y.T))};static#t=this.\u0275prov=P.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}return R})()},73012:(F,B,m)=>{m.d(B,{u:()=>x});var p=m(73308),P=m(2978),h=m(3366),y=m(54171);let x=(()=>{class R{constructor(o,a){this.api=o,this.utilsService=a,this.categories=[],this.businesses=[],this.centerFirstMarker=!1,this.userHaveBusiness=!1,this.loadingBusiness=!0}getCategories(o){var a=this;return(0,p.A)(function*(){return a.categories=[],new Promise(function(){var f=(0,p.A)(function*(E,v){(yield a.api.get("business/getCategories/"+o,yield a.utilsService.getAccessToken())).subscribe(n=>{a.categories=n,E(n)},n=>{console.error("Error getCategories",n),v(n)})});return function(E,v){return f.apply(this,arguments)}}())})()}registerBusiness(o){var a=this;return(0,p.A)(function*(){let f=yield a.utilsService.getAccessToken();return new Promise(function(){var E=(0,p.A)(function*(v,c){(yield a.api.post("business/register",o,f)).subscribe(n=>{v(n)},n=>{console.error("Error registerBusiness",n),c(n)})});return function(v,c){return E.apply(this,arguments)}}())})()}getBusinesses(o){var a=this;return(0,p.A)(function*(){a.params=o;let f=yield a.utilsService.getAccessToken();return o.reset&&(a.businesses=[]),new Promise(function(){var E=(0,p.A)(function*(v,c){(yield a.api.get("business/getBusinesses",f,o)).subscribe(g=>{a.loadingBusiness=!1,o.reset?a.businesses=g:a.businesses.push(...g),o.user&&g.length&&(a.userHaveBusiness=!0),a.centerFirstMarker=!(!o.search&&1!=g.length),v(a.businesses)},g=>{console.error("Error getBusinesses",g),c(g)})});return function(v,c){return E.apply(this,arguments)}}())})()}deleteBusiness(o){var a=this;return(0,p.A)(function*(){let f=yield a.utilsService.getAccessToken();return new Promise(function(){var E=(0,p.A)(function*(v,c){(yield a.api.delete("business/delete/"+o,f)).subscribe(n=>{v(n)},n=>{console.error("Error registerBusiness",n),c(n)})});return function(v,c){return E.apply(this,arguments)}}())})()}getParameters(){var o=this;return(0,p.A)(function*(){return new Promise(function(){var a=(0,p.A)(function*(f,E){(yield o.api.get("business/getParameters",yield o.utilsService.getAccessToken())).subscribe(c=>{f(c)},c=>{console.error("Error getParemeters",c),E(c)})});return function(f,E){return a.apply(this,arguments)}}())})()}getScoringOptions(){var o=this;return(0,p.A)(function*(){return new Promise(function(){var a=(0,p.A)(function*(f,E){(yield o.api.get("business/getScoringOptions",yield o.utilsService.getAccessToken())).subscribe(c=>{f(c)},c=>{console.error("Error getParemeters",c),E(c)})});return function(f,E){return a.apply(this,arguments)}}())})()}registerScoring(o){var a=this;return(0,p.A)(function*(){let f=yield a.utilsService.getAccessToken();return new Promise(function(){var E=(0,p.A)(function*(v,c){(yield a.api.post("business/scoreRegistry",o,f)).subscribe(n=>{v(n)},n=>{console.error("Error registerScoring",n),c(n)})});return function(v,c){return E.apply(this,arguments)}}())})()}static#e=this.\u0275fac=function(a){return new(a||R)(P.KVO(h.G),P.KVO(y.T))};static#t=this.\u0275prov=P.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}return R})()},41808:(F,B,m)=>{m.d(B,{I:()=>v});var p=m(73308),P=m(22126),h=function(c){return c.Prompt="PROMPT",c.Camera="CAMERA",c.Photos="PHOTOS",c}(h||{}),y=function(c){return c.Rear="REAR",c.Front="FRONT",c}(y||{}),x=function(c){return c.Uri="uri",c.Base64="base64",c.DataUrl="dataUrl",c}(x||{});class R extends P.E_{getPhoto(n){var g=this;return(0,p.A)(function*(){return new Promise(function(){var u=(0,p.A)(function*(d,_){if(n.webUseInput||n.source===h.Photos)g.fileInputExperience(n,d,_);else if(n.source===h.Prompt){let T=document.querySelector("pwa-action-sheet");T||(T=document.createElement("pwa-action-sheet"),document.body.appendChild(T)),T.header=n.promptLabelHeader||"Photo",T.cancelable=!1,T.options=[{title:n.promptLabelPhoto||"From Photos"},{title:n.promptLabelPicture||"Take Picture"}],T.addEventListener("onSelection",function(){var I=(0,p.A)(function*(S){0===S.detail?g.fileInputExperience(n,d,_):g.cameraExperience(n,d,_)});return function(S){return I.apply(this,arguments)}}())}else g.cameraExperience(n,d,_)});return function(d,_){return u.apply(this,arguments)}}())})()}pickImages(n){var g=this;return(0,p.A)(function*(){return new Promise(function(){var u=(0,p.A)(function*(d,_){g.multipleFileInputExperience(d,_)});return function(d,_){return u.apply(this,arguments)}}())})()}cameraExperience(n,g,u){var d=this;return(0,p.A)(function*(){if(customElements.get("pwa-camera-modal")){const _=document.createElement("pwa-camera-modal");_.facingMode=n.direction===y.Front?"user":"environment",document.body.appendChild(_);try{yield _.componentOnReady(),_.addEventListener("onPhoto",function(){var T=(0,p.A)(function*(I){const S=I.detail;null===S?u(new P.I9("User cancelled photos app")):S instanceof Error?u(S):g(yield d._getCameraPhoto(S,n)),_.dismiss(),document.body.removeChild(_)});return function(I){return T.apply(this,arguments)}}()),_.present()}catch{d.fileInputExperience(n,g,u)}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),d.fileInputExperience(n,g,u)})()}fileInputExperience(n,g,u){let d=document.querySelector("#_capacitor-camera-input");const _=()=>{var T;null===(T=d.parentNode)||void 0===T||T.removeChild(d)};d||(d=document.createElement("input"),d.id="_capacitor-camera-input",d.type="file",d.hidden=!0,document.body.appendChild(d),d.addEventListener("change",T=>{const I=d.files[0];let S="jpeg";if("image/png"===I.type?S="png":"image/gif"===I.type&&(S="gif"),"dataUrl"===n.resultType||"base64"===n.resultType){const M=new FileReader;M.addEventListener("load",()=>{if("dataUrl"===n.resultType)g({dataUrl:M.result,format:S});else if("base64"===n.resultType){const k=M.result.split(",")[1];g({base64String:k,format:S})}_()}),M.readAsDataURL(I)}else g({webPath:URL.createObjectURL(I),format:S}),_()}),d.addEventListener("cancel",T=>{u(new P.I9("User cancelled photos app")),_()})),d.accept="image/*",d.capture=!0,n.source===h.Photos||n.source===h.Prompt?d.removeAttribute("capture"):n.direction===y.Front?d.capture="user":n.direction===y.Rear&&(d.capture="environment"),d.click()}multipleFileInputExperience(n,g){let u=document.querySelector("#_capacitor-camera-input-multiple");const d=()=>{var _;null===(_=u.parentNode)||void 0===_||_.removeChild(u)};u||(u=document.createElement("input"),u.id="_capacitor-camera-input-multiple",u.type="file",u.hidden=!0,u.multiple=!0,document.body.appendChild(u),u.addEventListener("change",_=>{const T=[];for(let I=0;I<u.files.length;I++){const S=u.files[I];let M="jpeg";"image/png"===S.type?M="png":"image/gif"===S.type&&(M="gif"),T.push({webPath:URL.createObjectURL(S),format:M})}n({photos:T}),d()}),u.addEventListener("cancel",_=>{g(new P.I9("User cancelled photos app")),d()})),u.accept="image/*",u.click()}_getCameraPhoto(n,g){return new Promise((u,d)=>{const _=new FileReader,T=n.type.split("/")[1];"uri"===g.resultType?u({webPath:URL.createObjectURL(n),format:T,saved:!1}):(_.readAsDataURL(n),_.onloadend=()=>{const I=_.result;u("dataUrl"===g.resultType?{dataUrl:I,format:T,saved:!1}:{base64String:I.split(",")[1],format:T,saved:!1})},_.onerror=I=>{d(I)})})}checkPermissions(){var n=this;return(0,p.A)(function*(){if(typeof navigator>"u"||!navigator.permissions)throw n.unavailable("Permissions API not available in this browser");try{return{camera:(yield window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw n.unavailable("Camera permissions are not available in this browser")}})()}requestPermissions(){var n=this;return(0,p.A)(function*(){throw n.unimplemented("Not implemented on web.")})()}pickLimitedLibraryPhotos(){var n=this;return(0,p.A)(function*(){throw n.unavailable("Not implemented on web.")})()}getLimitedLibraryPhotos(){var n=this;return(0,p.A)(function*(){throw n.unavailable("Not implemented on web.")})()}}new R;const o=(0,P.F3)("Camera",{web:()=>new R});var a=m(2978),f=m(77897),E=m(22882);let v=(()=>{class c{constructor(g,u){this.actionSheetCtrl=g,this.translateService=u}actionSheetImage(g){var u=this;return(0,p.A)(function*(){return new Promise(function(){var d=(0,p.A)(function*(_,T){if(P.Ii.isNativePlatform()){const M=yield o.requestPermissions();if("denied"===M.photos||"denied"===M.camera)return;var I={quality:90,targetWidth:600,targetHeight:600,saveToPhotoAlbum:!1,correctOrientation:!0,cameraDirection:1,resultType:x.Base64,promptLabelHeader:u.translateService.instant("TITLE_ACTION_SHEET"),promptLabelPhoto:u.translateService.instant("TEXT2_ACTION_SHEET"),promptLabelPicture:u.translateService.instant("TEXT1_ACTION_SHEET")},S=yield o.getPhoto(I);_("data:image/"+S.format+";base64,"+S.base64String)}else g.click(),g.addEventListener("change",function(M){const k=M.target;if(k.files&&k.files.length>0){const U=k.files[0],L=new FileReader;L.onload=()=>{_(L.result)},L.readAsDataURL(U)}})});return function(_,T){return d.apply(this,arguments)}}())})()}static#e=this.\u0275fac=function(u){return new(u||c)(a.KVO(f.GD),a.KVO(E.c$))};static#t=this.\u0275prov=a.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})()}}]);