{"version":3,"sources":["widgets/profile/lady/info/main.es6.js"],"names":["create","container","ladyId","getZodiacSign","day","month","zodiacSigns","capricorn","aquarius","pisces","aries","taurus","gemini","cancer","leo","virgo","libra","scorpio","sagittarius","profilePromise","Promise","api","ladies","get","err","data","resolve","photosPromise","config","features","photoRepo","photos","tmplPromise","templates","tpl","textPromise","texts","all","then","values","reverse","profileModel","localization","length","photoFirst","photoSecond","smokingText","smoking","foots","height","fixedFoot","Math","floor","floatingFoot","round","heightText","weightText","weight","parseInt","bodyType","bodyTypeConvertor","convert","children","childrenList","i","current","push","gender","birthdate","last","childrenLast","Date","getMonth","birthdateText","getDate","getFullYear","textAge","textBirthday","textEyeColor","textHairColor","textHeight","textBodyType","textWeight","textMaritalStatus","textChildren","textLevelOfEducation","textOccupation","textDrinking","textSmoking","textLevelOfEnglish","textOtherLanguages","textLivesIn","textLevelOfEnglishDescription1","textLevelOfEnglishDescription2","textCharacter","textInterests","textTypeOfMan","append","render","find","attr","removeClass","addClass","emitter"],"mappings":";;;;YAMgBA,M,GAAAA,M;;;;;;;;;;;;;;;;;;;;AAAT,aAASA,MAAT,CAAgBC,SAAhB,EAA2BC,MAA3B,EAAmC;AACtC,iBAASC,aAAT,CAAuBC,GAAvB,EAA4BC,KAA5B,EAAmC;;AAE/B,gBAAIC,cAAc;AACd,6BAAY,WADE;AAEd,4BAAW,UAFG;AAGd,0BAAS,QAHK;AAId,yBAAQ,OAJM;AAKd,0BAAS,QALK;AAMd,0BAAS,QANK;AAOd,0BAAS,QAPK;AAQd,uBAAM,KARQ;AASd,yBAAQ,OATM;AAUd,yBAAQ,OAVM;AAWd,2BAAU,SAXI;AAYd,+BAAc;AAZA,aAAlB;;AAeA,gBAAID,SAAS,CAAT,IAAcD,OAAO,EAAtB,IAA8BC,SAAS,EAAT,IAAeD,OAAM,EAAtD,EAA2D;AACvD,uBAAOE,YAAYC,SAAnB;AACH,aAFD,MAEO,IAAKF,SAAS,CAAT,IAAcD,OAAO,EAAtB,IAA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AAX,CAAjB;AACA,gBAAG,CAACA,aAAaG,UAAd,IAA4B,CAACH,aAAaI,WAA7C,EAAyD;AACrD5C,0BAAUkG,IAAV,CAAe,0CAAf,EAA2DC,IAA3D,CAAgE,SAAhE,EAA0E,GAA1E;AACAnG,0BAAUkG,IAAV,CAAe,2CAAf,EAA4DE,WAA5D,CAAwE,qBAAxE,EAA+FC,QAA/F,CAAwG,qBAAxG,EAA+HF,IAA/H,CAAoI,SAApI,EAA8I,GAA9I;AACH;AACD,gBAAG3D,aAAaG,UAAhB,EAA2B;AACvB2D,+BAAQvG,MAAR,CAAeC,UAAUkG,IAAV,CAAe,mEAAf,CAAf,EAAmG,cAAnG,EAAkH,GAAlH;AACH;AACD,gBAAG1D,aAAaI,WAAhB,EAA4B;AACxB0D,+BAAQvG,MAAR,CAAeC,UAAUkG,IAAV,CAAe,iDAAf,CAAf,EAAiF,cAAjF,EAAgG,GAAhG;AACH;AACJ,SArFD;AAsFH","file":"widgets/profile/lady/info/main.js","sourceRoot":"/source/","sourcesContent":["import api from 'api';\r\nimport templates from 'modules/templates';\r\nimport photoRepo from 'repositories/ladies';\r\nimport bodyTypeConvertor from 'modules/body-type/convertor';\r\nimport config from 'config';\r\nimport emitter from 'widgets/events/emitter/main';\r\nexport function create(container, ladyId) {\r\n function getZodiacSign(day, month) {\r\n\r\n var zodiacSigns = {\r\n 'capricorn':'Capricorn',\r\n 'aquarius':'Aquarius',\r\n 'pisces':'Pisces',\r\n 'aries':'Aries',\r\n 'taurus':'Taurus',\r\n 'gemini':'Gemini',\r\n 'cancer':'Cancer',\r\n 'leo':'Leo',\r\n 'virgo':'Virgo',\r\n 'libra':'Libra',\r\n 'scorpio':'Scorpio',\r\n 'sagittarius':'Sagittarius'\r\n }\r\n\r\n if((month == 1 && day <= 20) || (month == 12 && day >=22)) {\r\n return zodiacSigns.capricorn;\r\n } else if ((month == 1 && day >= 21) || (month == 2 && day <= 18)) {\r\n return zodiacSigns.aquarius;\r\n } else if((month == 2 && day >= 19) || (month == 3 && day <= 20)) {\r\n return zodiacSigns.pisces;\r\n } else if((month == 3 && day >= 21) || (month == 4 && day <= 20)) {\r\n return zodiacSigns.aries;\r\n } else if((month == 4 && day >= 21) || (month == 5 && day <= 20)) {\r\n return zodiacSigns.taurus;\r\n } else if((month == 5 && day >= 21) || (month == 6 && day <= 20)) {\r\n return zodiacSigns.gemini;\r\n } else if((month == 6 && day >= 22) || (month == 7 && day <= 22)) {\r\n return zodiacSigns.cancer;\r\n } else if((month == 7 && day >= 23) || (month == 8 && day <= 23)) {\r\n return zodiacSigns.leo;\r\n } else if((month == 8 && day >= 24) || (month == 9 && day <= 23)) {\r\n return zodiacSigns.virgo;\r\n } else if((month == 9 && day >= 24) || (month == 10 && day <= 23)) {\r\n return zodiacSigns.libra;\r\n } else if((month == 10 && day >= 24) || (month == 11 && day <= 22)) {\r\n return zodiacSigns.scorpio;\r\n } else if((month == 11 && day >= 23) || (month == 12 && day <= 21)) {\r\n return zodiacSigns.sagittarius;\r\n }\r\n }\r\n\r\n let profilePromise = new Promise(resolve => {\r\n api.ladies.get(ladyId, function(err, data){\r\n resolve(data);\r\n });\r\n });\r\n let photosPromise = new Promise(resolve => {\r\n if(config && config.features && config.features['private-photos-on-top']){\r\n photoRepo.photos(ladyId, {\r\n }, function (err, data) {\r\n resolve(data);\r\n });\r\n }else{\r\n photoRepo.photos(ladyId, {\r\n }, function (err, data) {\r\n resolve(data);\r\n },'private');\r\n }\r\n\r\n });\r\n let tmplPromise = new Promise(resolve => {\r\n templates.get('profile-info', function (err, tpl) {\r\n resolve(tpl);\r\n })\r\n });\r\n\r\n let textPromise = new Promise(resolve => {\r\n api.texts.get('lady/card', function(err, data){\r\n resolve(data);\r\n });\r\n });\r\n\r\n Promise.all([profilePromise,photosPromise, tmplPromise,textPromise]).then(values => {\r\n var photos = (values[1] || []).reverse();\r\n var profileModel = values[0];\r\n var tpl = values[2];\r\n var localization = values[3];\r\n\r\n if(photos.length === 1){\r\n profileModel.photoFirst = photos[0];\r\n }else if(photos.length > 1){\r\n profileModel.photoFirst = photos[0];\r\n profileModel.photoSecond = photos[1];\r\n }\r\n\r\n profileModel.smokingText = (profileModel.smoking === null || profileModel.smoking===false) ? 'No' : 'Yes';\r\n var foots = profileModel.height*0.393700/12;\r\n var fixedFoot = Math.floor(foots);\r\n var floatingFoot = Math.round((foots - fixedFoot) * 12);\r\n\r\n if(config && config.features && config.features['metric-system']){\r\n profileModel.heightText = `${profileModel.height} cm (${fixedFoot}' ${floatingFoot}\")`;\r\n profileModel.weightText = `${profileModel.weight} kg (${Math.floor(parseInt(profileModel.weight)*2.2)} lbs)`;\r\n\r\n }else{\r\n profileModel.heightText = `${fixedFoot}' ${floatingFoot}\" (${profileModel.height} cm)`;\r\n profileModel.weightText = `${Math.floor(parseInt(profileModel.weight)*2.2)} lbs (${profileModel.weight} kg)`;\r\n }\r\n profileModel.bodyType = bodyTypeConvertor.convert(profileModel.height, profileModel.weight);\r\n\r\n\r\n if(profileModel.children.length > 0){\r\n profileModel.childrenList = [];\r\n for(var i=0;i 9 ? month : ('0' + month)}/${birthdate.getDate()}/${birthdate.getFullYear()} (${getZodiacSign(birthdate.getDate(), birthdate.getMonth() + 1)})`;\r\n\r\n profileModel.textAge = localization['age'];\r\n profileModel.textBirthday = localization['birthday'];\r\n profileModel.textEyeColor = localization['eye-color'];\r\n profileModel.textHairColor = localization['hair-color'];\r\n profileModel.textHeight = localization['height'];\r\n profileModel.textBodyType = localization['body-type'];\r\n profileModel.textWeight = localization['weight'];\r\n profileModel.textMaritalStatus = localization['marital-status'];\r\n profileModel.textChildren = localization['children'];\r\n profileModel.textLevelOfEducation = localization['level-of-education'];\r\n profileModel.textOccupation = localization['occupation'];\r\n profileModel.textDrinking = localization['drinking'];\r\n profileModel.textSmoking = localization['smoking'];\r\n profileModel.textLevelOfEnglish = localization['level-of-english'];\r\n profileModel.textOtherLanguages = localization['other-languages'];\r\n profileModel.textLivesIn = localization['lives-in'];\r\n profileModel.textLevelOfEnglishDescription1 = localization['level-of-english-description-1'];\r\n profileModel.textLevelOfEnglishDescription2 = localization['level-of-english-description-2'];\r\n\r\n profileModel.textCharacter = localization['character'];\r\n profileModel.textInterests = localization['interests'];\r\n profileModel.textTypeOfMan = localization['type-of-man'];\r\n\r\n container.append(tpl.render(profileModel));\r\n if(!profileModel.photoFirst && !profileModel.photoSecond){\r\n container.find('.first-part-profile .ladyProfile-content').attr('colspan','2');\r\n container.find('.second-part-profile .ladyProfile-content').removeClass('ladyProfile-content').addClass('padTop15 padRight15').attr('colspan','2');\r\n }\r\n if(profileModel.photoFirst){\r\n emitter.create(container.find('.first-part-profile .ladyProfile-photo .photo-wrapper .to-gallery'),'gallery:init','0');\r\n }\r\n if(profileModel.photoSecond){\r\n emitter.create(container.find('.second-part-profile .photo-wrapper .to-gallery'),'gallery:init','1');\r\n }\r\n });\r\n}"]}