import { A as APIBase } from './kimlikApi-ac700c81.js';
import { g as generateFieldModelFromRawData } from './FieldModelGenerator-ee438a53.js';
import './index-a1675f50.js';
import { S as SingleChoiceField, M as MultipleChoiceField } from './index-0e8b9ea2.js';
import { R as RangeField } from './index-c3eacf05.js';
import { R as ReferenceField } from './index-ef734a5e.js';
import { T as TextField } from './index-336ef773.js';
import { D as DataModel } from './data-model-f5160369.js';
import { M as Membership } from './membership-821de3c5.js';
import { M as MembershipConfig } from './membership-config-68ed7772.js';
import { U as User } from './User-d2ee8b71.js';
import { C as CalendarConfig } from './CalendarConfig-cc1e3a80.js';
import { a as generateMembershipConfigForRole } from './session-4127c2a1.js';
import { a as AttachmentField } from './attachment-32decf79.js';

const skills = [
  'academic',
  'accounting',
  'activism',
  'ads',
  'advertising',
  'affiliate-marketing',
  'analytics',
  'apis',
  'ar',
  'art',
  'artificial-intelligence',
  'audit',
  'automotive',
  'b2b',
  'b2c',
  'backend',
  'banking',
  'behavior-change',
  'bidding',
  'big-data',
  'biodiversity',
  'biotechnology',
  'blockchain',
  'blogs',
  'branching',
  'brand',
  'broadcasting',
  'buildings',
  'business',
  'business-administration',
  'business-dev',
  'business-model',
  'business-planning',
  'c2c',
  'chemistry',
  'churn-management',
  'circular-economy',
  'cloud-computing',
  'coding',
  'communications',
  'communities',
  'community-management',
  'construction',
  'content-management',
  'content-marketing',
  'contract-administration',
  'crowdfunding',
  'crowd-sourcing',
  'cryptocurrency',
  'customer-relations',
  'customs',
  'data-science',
  'deep-learning',
  'defense-industry',
  'delivery-services',
  'demodays',
  'design',
  'design-thinking',
  'diabetes',
  'diagnostics',
  'digital-marketing',
  'distribution',
  'drip-marketing',
  'drones',
  'dropshipping',
  'earth-observation',
  'e-commerce',
  'edtech',
  'education',
  'e-learning',
  'electric-cars',
  'elevator-pitch',
  'email-marketing',
  'emea',
  'employee-engagement',
  'energy',
  'entrepreneurship',
  'esports',
  'estate',
  'eu',
  'event-management',
  'executive-coaching',
  'finance',
  'fintech',
  'fmcg',
  'food',
  'foreign-trade',
  'franchising',
  'frontend',
  'funding',
  'fundraising-strategy',
  'game-development',
  'gdpr',
  'gov-relations',
  'grants',
  'graphic-design',
  'growth-hacking',
  'hardware',
  'health',
  'human-resources',
  'ico',
  'idea-proof',
  'indiegogo',
  'innovation',
  'insurance',
  'insuretech',
  'international-sales',
  'investor-relations',
  'iot',
  'ipo',
  'it',
  'kickstarter',
  'landing-pages',
  'law',
  'leadership',
  'lead-generation',
  'lean-startup',
  'life-sciences',
  'machine-learning',
  'management-consulting',
  'marketing',
  'marketing-automations',
  'marketplace',
  'market-research',
  'materials',
  'materials-science',
  'medicine',
  'medtech',
  'mena',
  'mindfulness',
  'mobile-development',
  'motivation',
  'nanotechnology',
  'networking',
  'nutrition',
  'online-games',
  'open-source',
  'organic-foods',
  'organizational-development',
  'patent',
  'payment-systems',
  'pitch-decks',
  'pitching',
  'planning',
  'politics',
  'presentation-design',
  'presentation-skills',
  'press',
  'pricing',
  'privacy',
  'procurement',
  'prod',
  'prod-dev',
  'professional-coaching',
  'project-management',
  'psychology',
  'public-relations',
  'publishing',
  'purchasing',
  'quality',
  'recruitment',
  'renewables',
  'reseller-management',
  'resilience',
  'robotics',
  'saas',
  'sales',
  'satellite-navigation',
  'search-engines',
  'sea-technologies',
  'security',
  'sem',
  'service-design',
  'sharing-economy',
  'shipping',
  'silicon-valley',
  'smart-cities',
  'social-entrepreneurship',
  'social-media',
  'soft-skills',
  'software',
  'software-dev',
  'solar-power',
  'space-tech',
  'sports',
  'statistics',
  'storytelling',
  'strategy',
  'supply-chain',
  'sustainability',
  'talent-management',
  'taxes',
  'team-management',
  'tech',
  'telecom',
  'time-management',
  'tourism',
  'transport',
  'travel',
  'ui',
  'unit-economics',
  'ux',
  'ux-design',
  'ux-research',
  'vc',
  'vegan-foods',
  'viral-marketing',
  'virology',
  'vr',
  'waste',
  'water',
  'wind-power',
  'youtube',
];

const skillsEN = {
  analytics: 'Analytics',
  business: 'Business',
  chemistry: 'Chemistry',
  'data-science': 'Data Science',
  'design-thinking': 'Design Thinking',
  diabetes: 'Diabetes',
  diagnostics: 'Diagnostics',
  'graphic-design': 'Graphic Design',
  'life-sciences': 'Life sciences',
  medicine: 'Medicine',
  medtech: 'Medtech',
  pitching: 'Pitching',
  'presentation-design': 'Presentation Design',
  'service-design': 'Service Design',
  'ux-design': 'UX design',
  'ux-research': 'UX research',
  virology: 'Virology',
  academic: 'Academic',
  accounting: 'Accounting',
  activism: 'Activism',
  ads: 'Ads',
  advertising: 'Advertising',
  'affiliate-marketing': 'Affiliate Marketing',
  apis: 'APIs',
  ar: 'AR Augmented Reality',
  art: 'Art',
  'artificial-intelligence': 'Ai Artificial Intelligence',
  audit: 'Audit',
  automotive: 'Automotive',
  b2b: 'B2B',
  b2c: 'B2C',
  backend: 'Backend',
  banking: 'Banking',
  'behavior-change': 'Behavior Change',
  bidding: 'Bidding',
  'big-data': 'Big Data',
  biodiversity: 'Biodiversity',
  biotechnology: 'Biotechnology',
  blockchain: 'Blockchain',
  blogs: 'Blogs',
  branching: 'Branching',
  brand: 'Brand',
  broadcasting: 'Broadcasting',
  buildings: 'Buildings',
  'business-administration': 'Business Administration',
  'business-dev': 'Business Development',
  'business-model': 'Business Model',
  'business-planning': 'Business Planning',
  c2c: 'C2C',
  'churn-management': 'Churn Management',
  'circular-economy': 'Circular Economy',
  'cloud-computing': 'Cloud Computing',
  coding: 'Coding',
  communications: 'Communications',
  communities: 'Communities',
  'community-management': 'Community Management',
  construction: 'Construction',
  'content-management': 'Content Management',
  'content-marketing': 'Content Marketing',
  'contract-administration': 'Contract Administration',
  crowdfunding: 'CrowdFunding',
  'crowd-sourcing': 'Crowd Sourcing',
  cryptocurrency: 'CryptoCurrency',
  'customer-relations': 'Customer Relations',
  customs: 'Customs',
  'deep-learning': 'Deep Learning',
  'defense-industry': 'Defense Industry',
  'delivery-services': 'Delivery Services',
  demodays: 'Demodays',
  design: 'Design',
  'digital-marketing': 'Digital Marketing',
  distribution: 'Distribution',
  'drip-marketing': 'Drip Marketing',
  drones: 'Drones',
  dropshipping: 'Dropshipping',
  'earth-observation': 'Earth Observation',
  'e-commerce': 'E-Commerce',
  edtech: 'EdTech',
  education: 'Education',
  'e-learning': 'E-Learning',
  'electric-cars': 'Electric Cars',
  'elevator-pitch': 'Elevator Pitch',
  'email-marketing': 'Email Marketing',
  emea: 'EMEA Region',
  'employee-engagement': 'Employee Engagement',
  energy: 'Energy',
  entrepreneurship: 'Entrepreneurship',
  esports: 'ESports',
  estate: 'Estate',
  eu: 'EU European Union',
  'event-management': 'Event Management',
  'executive-coaching': 'Executive Coaching',
  finance: 'Finance',
  fintech: 'FinTech',
  fmcg: 'FMCG',
  food: 'Food',
  'foreign-trade': 'Foreign Trade',
  franchising: 'Franchising',
  frontend: 'Frontend',
  funding: 'Funding',
  'fundraising-strategy': 'Fundraising Strategy',
  'game-development': 'Game Development',
  gdpr: 'GDPR',
  'gov-relations': 'Government Relations',
  grants: 'Grants',
  'growth-hacking': 'Growth Hacking',
  hardware: 'Hardware',
  health: 'Health',
  'human-resources': 'HR Human Resources',
  ico: 'ICO',
  'idea-proof': 'Idea Proof',
  indiegogo: 'Indiegogo',
  innovation: 'Innovation',
  insurance: 'Insurance',
  insuretech: 'InsureTech',
  'international-sales': 'International Sales',
  'investor-relations': 'Investor Relations',
  iot: 'IoT',
  ipo: 'IPO',
  it: 'IT',
  kickstarter: 'Kickstarter',
  'landing-pages': 'Landing Pages',
  law: 'Law',
  leadership: 'Leadership',
  'lead-generation': 'Lead Generation',
  'lean-startup': 'Lean Startup',
  'machine-learning': 'Machine Learning',
  'management-consulting': 'Management Consulting',
  marketing: 'Marketing',
  'marketing-automations': 'Marketing Automations',
  marketplace: 'Marketplace',
  'market-research': 'Market Research',
  materials: 'Materials',
  'materials-science': 'Materials Science',
  mena: 'MENA Region',
  mindfulness: 'Mindfulness',
  'mobile-development': 'Mobile Development',
  motivation: 'Motivation',
  nanotechnology: 'Nanotechnology',
  networking: 'Networking',
  nutrition: 'Nutrition',
  'online-games': 'Online Games',
  'open-source': 'Open Source',
  'organic-foods': 'Organic Foods',
  'organizational-development': 'Organizational Development',
  patent: 'Patent',
  'payment-systems': 'Payment Systems',
  'pitch-decks': 'Pitch Decks',
  planning: 'Planning',
  politics: 'Politics',
  'presentation-skills': 'Presentation Skills',
  press: 'Press',
  pricing: 'Pricing',
  privacy: 'Privacy',
  procurement: 'Procurement',
  prod: 'Product',
  'prod-dev': 'Product Development',
  'professional-coaching': 'Professional Coaching',
  'project-management': 'Project Management',
  psychology: 'Psychology',
  'public-relations': 'PR Public Relations',
  publishing: 'Publishing',
  purchasing: 'Purchasing ',
  quality: 'Quality',
  recruitment: 'Recruitment',
  renewables: 'Renewables',
  'reseller-management': 'Reseller Management',
  resilience: 'Resilience',
  robotics: 'Robotics',
  saas: 'SaaS',
  sales: 'Sales',
  'satellite-navigation': 'Satellite Navigation',
  'search-engines': 'Search Engines',
  'sea-technologies': 'Sea Technologies',
  security: 'Security',
  sem: 'SEM Serch Engine Marketing',
  'sharing-economy': 'Sharing Economy',
  shipping: 'Shipping',
  'silicon-valley': 'Silicon Valley',
  'smart-cities': 'Smart Cities',
  'social-entrepreneurship': 'Social Entrepreneurship',
  'social-media': 'Social media',
  'soft-skills': 'Soft Skills',
  software: 'Software',
  'software-dev': 'Software Development',
  'solar-power': 'Solar Power',
  'space-tech': 'Space Tech',
  sports: 'Sports',
  statistics: 'Statistics',
  storytelling: 'Storytelling',
  strategy: 'Strategy',
  'supply-chain': 'Supply Chain',
  sustainability: 'Sustainability',
  'talent-management': 'Talent Management',
  taxes: 'Taxes',
  'team-management': 'Team Management',
  tech: 'Tech',
  telecom: 'Telecom',
  'time-management': 'Time Management',
  tourism: 'Tourism',
  transport: 'Transport',
  travel: 'Travel',
  ui: 'UI',
  'unit-economics': 'Unit Economics',
  ux: 'UX',
  vc: 'VC Venture Capitals',
  'vegan-foods': 'Vegan foods',
  'viral-marketing': 'Viral Marketing',
  vr: 'VR Virtual Reality',
  waste: 'Waste',
  water: 'Water',
  'wind-power': 'Wind Power',
  youtube: 'Youtube',
};

const skillsPtBr = {
  analytics: 'Analytics',
  business: 'Business',
  chemistry: 'Chemistry',
  'data-science': 'Data Science',
  'design-thinking': 'Design Thinking',
  diabetes: 'Diabetes',
  diagnostics: 'Diagnostics',
  'graphic-design': 'Graphic Design',
  'life-sciences': 'Life sciences',
  medicine: 'Medicine',
  medtech: 'Medtech',
  pitching: 'Pitching',
  'presentation-design': 'Presentation Design',
  'service-design': 'Service Design',
  'ux-design': 'UX design',
  'ux-research': 'UX research',
  virology: 'Virology',
  academic: 'Academic',
  accounting: 'Accounting',
  activism: 'Activism',
  ads: 'Ads',
  advertising: 'Advertising',
  'affiliate-marketing': 'Affiliate Marketing',
  apis: 'APIs',
  ar: 'AR Augmented Reality',
  art: 'Art',
  'artificial-intelligence': 'Ai Artificial Intelligence',
  audit: 'Audit',
  automotive: 'Automotive',
  b2b: 'B2B',
  b2c: 'B2C',
  backend: 'Backend',
  banking: 'Banking',
  'behavior-change': 'Behavior Change',
  bidding: 'Bidding',
  'big-data': 'Big Data',
  biodiversity: 'Biodiversity',
  biotechnology: 'Biotechnology',
  blockchain: 'Blockchain',
  blogs: 'Blogs',
  branching: 'Branching',
  brand: 'Brand',
  broadcasting: 'Broadcasting',
  buildings: 'Buildings',
  'business-administration': 'Business Administration',
  'business-dev': 'Business Development',
  'business-model': 'Business Model',
  'business-planning': 'Business Planning',
  c2c: 'C2C',
  'churn-management': 'Churn Management',
  'circular-economy': 'Circular Economy',
  'cloud-computing': 'Cloud Computing',
  coding: 'Coding',
  communications: 'Communications',
  communities: 'Communities',
  'community-management': 'Community Management',
  construction: 'Construction',
  'content-management': 'Content Management',
  'content-marketing': 'Content Marketing',
  'contract-administration': 'Contract Administration',
  crowdfunding: 'CrowdFunding',
  'crowd-sourcing': 'Crowd Sourcing',
  cryptocurrency: 'CryptoCurrency',
  'customer-relations': 'Customer Relations',
  customs: 'Customs',
  'deep-learning': 'Deep Learning',
  'defense-industry': 'Defense Industry',
  'delivery-services': 'Delivery Services',
  demodays: 'Demodays',
  design: 'Design',
  'digital-marketing': 'Digital Marketing',
  distribution: 'Distribution',
  'drip-marketing': 'Drip Marketing',
  drones: 'Drones',
  dropshipping: 'Dropshipping',
  'earth-observation': 'Earth Observation',
  'e-commerce': 'E-Commerce',
  edtech: 'EdTech',
  education: 'Education',
  'e-learning': 'E-Learning',
  'electric-cars': 'Electric Cars',
  'elevator-pitch': 'Elevator Pitch',
  'email-marketing': 'Email Marketing',
  emea: 'EMEA Region',
  'employee-engagement': 'Employee Engagement',
  energy: 'Energy',
  entrepreneurship: 'Entrepreneurship',
  esports: 'ESports',
  estate: 'Estate',
  eu: 'EU European Union',
  'event-management': 'Event Management',
  'executive-coaching': 'Executive Coaching',
  finance: 'Finance',
  fintech: 'FinTech',
  fmcg: 'FMCG',
  food: 'Food',
  'foreign-trade': 'Foreign Trade',
  franchising: 'Franchising',
  frontend: 'Frontend',
  funding: 'Funding',
  'fundraising-strategy': 'Fundraising Strategy',
  'game-development': 'Game Development',
  gdpr: 'GDPR',
  'gov-relations': 'Government Relations',
  grants: 'Grants',
  'growth-hacking': 'Growth Hacking',
  hardware: 'Hardware',
  health: 'Health',
  'human-resources': 'HR Human Resources',
  ico: 'ICO',
  'idea-proof': 'Idea Proof',
  indiegogo: 'Indiegogo',
  innovation: 'Innovation',
  insurance: 'Insurance',
  insuretech: 'InsureTech',
  'international-sales': 'International Sales',
  'investor-relations': 'Investor Relations',
  iot: 'IoT',
  ipo: 'IPO',
  it: 'IT',
  kickstarter: 'Kickstarter',
  'landing-pages': 'Landing Pages',
  law: 'Law',
  leadership: 'Leadership',
  'lead-generation': 'Lead Generation',
  'lean-startup': 'Lean Startup',
  'machine-learning': 'Machine Learning',
  'management-consulting': 'Management Consulting',
  marketing: 'Marketing',
  'marketing-automations': 'Marketing Automations',
  marketplace: 'Marketplace',
  'market-research': 'Market Research',
  materials: 'Materials',
  'materials-science': 'Materials Science',
  mena: 'MENA Region',
  mindfulness: 'Mindfulness',
  'mobile-development': 'Mobile Development',
  motivation: 'Motivation',
  nanotechnology: 'Nanotechnology',
  networking: 'Networking',
  nutrition: 'Nutrition',
  'online-games': 'Online Games',
  'open-source': 'Open Source',
  'organic-foods': 'Organic Foods',
  'organizational-development': 'Organizational Development',
  patent: 'Patent',
  'payment-systems': 'Payment Systems',
  'pitch-decks': 'Pitch Decks',
  planning: 'Planning',
  politics: 'Politics',
  'presentation-skills': 'Presentation Skills',
  press: 'Press',
  pricing: 'Pricing',
  privacy: 'Privacy',
  procurement: 'Procurement',
  prod: 'Product',
  'prod-dev': 'Product Development',
  'professional-coaching': 'Professional Coaching',
  'project-management': 'Project Management',
  psychology: 'Psychology',
  'public-relations': 'PR Public Relations',
  publishing: 'Publishing',
  purchasing: 'Purchasing ',
  quality: 'Quality',
  recruitment: 'Recruitment',
  renewables: 'Renewables',
  'reseller-management': 'Reseller Management',
  resilience: 'Resilience',
  robotics: 'Robotics',
  saas: 'SaaS',
  sales: 'Sales',
  'satellite-navigation': 'Satellite Navigation',
  'search-engines': 'Search Engines',
  'sea-technologies': 'Sea Technologies',
  security: 'Security',
  sem: 'SEM Serch Engine Marketing',
  'sharing-economy': 'Sharing Economy',
  shipping: 'Shipping',
  'silicon-valley': 'Silicon Valley',
  'smart-cities': 'Smart Cities',
  'social-entrepreneurship': 'Social Entrepreneurship',
  'social-media': 'Social media',
  'soft-skills': 'Soft Skills',
  software: 'Software',
  'software-dev': 'Software Development',
  'solar-power': 'Solar Power',
  'space-tech': 'Space Tech',
  sports: 'Sports',
  statistics: 'Statistics',
  storytelling: 'Storytelling',
  strategy: 'Strategy',
  'supply-chain': 'Supply Chain',
  sustainability: 'Sustainability',
  'talent-management': 'Talent Management',
  taxes: 'Taxes',
  'team-management': 'Team Management',
  tech: 'Tech',
  telecom: 'Telecom',
  'time-management': 'Time Management',
  tourism: 'Tourism',
  transport: 'Transport',
  travel: 'Travel',
  ui: 'UI',
  'unit-economics': 'Unit Economics',
  ux: 'UX',
  vc: 'VC Venture Capitals',
  'vegan-foods': 'Vegan foods',
  'viral-marketing': 'Viral Marketing',
  vr: 'VR Virtual Reality',
  waste: 'Waste',
  water: 'Water',
  'wind-power': 'Wind Power',
  youtube: 'Youtube',
};

const skillsTr = {
  'business-model': 'İş Modeli',
  'lean-startup': 'Yalın Girişim',
  'business-dev': 'İş Geliştirme',
  'business-administration': 'İş Yönetimi',
  'market-research': 'Pazar Araştırması',
  pricing: 'Fiyatlandırma',
  statistics: 'İstatistik',
  'idea-proof': 'Fikir Doğrulama',
  leadership: 'Liderlik',
  entrepreneurship: 'Girişimcilik',
  'management-consulting': 'Yönetim Danışmanlığı',
  strategy: 'Strateji',
  'project-management': 'Proje Yönetimi',
  planning: 'Planlama',
  'human-resources': 'İnsan Kaynakları HR',
  law: 'Hukuk',
  finance: 'Finans',
  accounting: 'Muhasebe',
  audit: 'Denetim',
  brand: 'Marka',
  patent: 'Patent',
  'foreign-trade': 'Dış Ticaret',
  customs: 'Gümrük',
  sales: 'Satış',
  marketing: 'Pazarlama',
  ads: 'Reklam',
  'digital-marketing': 'Dijital Pazarlama',
  'growth-hacking': 'Kullanıcı Edinme',
  'search-engines': 'Arama Motorları',
  'social-media': 'Sosyal Medya',
  'content-management': 'İçerik Yönetimi',
  'public-relations': 'PR Halkla İlişkiler',
  'customer-relations': 'Müşteri İlişkileri',
  'gov-relations': 'Devlet İle İlişkiler',
  funding: 'Fon Bulma',
  'investor-relations': 'Yatırımcı İlişkileri',
  'crowd-sourcing': 'Kitlesel Fonlama',
  grants: 'Hibe ve Destekler',
  b2b: 'B2B',
  b2c: 'B2C',
  c2c: 'C2C',
  design: 'Tasarım',
  ux: 'UX',
  ui: 'UI',
  'software-dev': 'Yazılım Geliştirme',
  'prod-dev': 'Ürün Geliştirme',
  quality: 'Kalite Yönetimi',
  prod: 'Üretim',
  distribution: 'Dağıtım',
  tech: 'Teknoloji',
  it: 'IT',
  software: 'Yazılım',
  hardware: 'Donanım',
  iot: 'IoT',
  telecom: 'Telekom',
  'cloud-computing': 'Bulut Bilişim',
  saas: 'SaaS',
  'big-data': 'Big Data',
  banking: 'Bankacılık',
  fintech: 'FinTech',
  'e-commerce': 'E-ticaret',
  marketplace: 'Pazaryeri',
  education: 'Eğitim',
  health: 'Sağlık',
  nutrition: 'Gıda',
  tourism: 'Turizm',
  construction: 'İnşaat',
  estate: 'Emlak',
  automotive: 'Otomotiv',
  art: 'Sanat',
  sports: 'Spor',
  press: 'Basın',
  publishing: 'Yayıncılık',
  advertising: 'Reklamcılık',
  energy: 'Enerji',
  sustainability: 'Sürdürülebilirlik',
  resilience: 'Dayanıklılık',
  procurement: 'Tedarik',
  renewables: 'Yenilenebilir Enerji',
  buildings: 'Yapılar',
  'electric-cars': 'Electirikli Araçlar',
  'circular-economy': 'Döngüsel Ekonomi',
  'supply-chain': 'Tedarik Zinciri',
  'behavior-change': 'Davranış Değişimi',
};

var __rest = (undefined && undefined.__rest) || function (s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
    t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
    for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
      if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
        t[p[i]] = s[p[i]];
    }
  return t;
};
function getRequestStatus(request) {
  if (request.status === 'completed') {
    return 'completed';
  }
  if (request.rejectedAt) {
    return 'rejected';
  }
  else if (request.canceledAt) {
    return 'canceled';
  }
  else if (request.acceptedAt) {
    return 'accepted';
  }
  else if (request.requestedAt) {
    return 'requested';
  }
}
const embeddedTranslations = {
  en: {
    title: 'Title',
    bio: 'Bio',
    skills: 'Professional Expertise',
    search: 'Search',
    goToProfilePage: 'Go to Profile Page',
    info: 'Info',
    getMeeting: 'Get Meeting',
    viewDetails: 'View Details',
    meetings: 'Meetings',
    follow: 'Follow',
    unfollow: 'Unfollow',
    sendMessage: 'Send Message'
  },
  'pt-br': {
    title: 'Titulo',
    bio: 'Bio',
    skills: 'Expertise profissional',
    search: 'Buscar',
    goToProfilePage: 'Vá para a página do perfil',
    info: 'Informação',
    getMeeting: 'Agendar Sessões',
    viewDetails: 'Ver detalhes',
    meetings: 'Sessões',
    follow: 'Seguir',
    unfollow: 'Deixar de seguir',
    sendMessage: 'Enviar mensagem'
  },
  tr: {
    title: 'Ünvan',
    bio: 'Özgeçmiş',
    skills: 'Uzmanlık alanları',
    search: 'Ara',
    goToProfilePage: 'Profil Sayfasına Git',
    info: 'Bilgi',
    getMeeting: 'Toplantı Oluştur',
    viewDetails: 'Detayları Gör',
    meetings: 'Toplantılar',
    follow: 'Takip Et',
    unfollow: 'Takibi Bırak',
    sendMessage: 'Mesaj Gönder'
  },
};
function getEmbeddedTranslation(language, key) {
  return (embeddedTranslations[language] || embeddedTranslations.en)[key];
}
const legacyProfileFields = (language = 'en') => {
  const strings = embeddedTranslations[language] || embeddedTranslations.en;
  let skillStrings = skillsEN;
  switch (language) {
    case 'pt-br':
      skillStrings = skillsPtBr;
      break;
    case 'tr':
      skillStrings = skillsTr;
      break;
  }
  return [
    generateFieldModelFromRawData({ id: 'title', title: strings.title, type: 'text' }),
    generateFieldModelFromRawData({ id: 'bio', title: strings.bio, type: 'text', lines: 3 }),
    generateFieldModelFromRawData({
      id: 'skills',
      title: strings.skills,
      type: 'multiple-choice',
      inputType: 'tag-cloud',
      options: skills.map(skill => ({
        label: skillStrings[skill] || skill, value: skill,
      })),
    }),
  ];
};
const commonUserInfoFields = [
  generateFieldModelFromRawData({ id: 'name', type: 'text' }),
  generateFieldModelFromRawData({ id: 'imageUrl', type: 'image' }),
  generateFieldModelFromRawData({ id: 'title', title: 'Title', type: 'text' }),
  generateFieldModelFromRawData({ id: 'bio', title: 'Bio', type: 'text', lines: 3 }),
  generateFieldModelFromRawData({ id: 'imagePlaceholderValue', title: '', type: 'text' }),
  generateFieldModelFromRawData({
    id: 'skills',
    title: 'Professional Expertise',
    type: 'multiple-choice',
    inputType: 'tag-cloud',
    options: skills.map(skill => ({
      label: skillsEN[skill], value: skill,
    })),
  }),
];
const groupInfoFields = [
  generateFieldModelFromRawData({ id: 'imageUrl', type: 'image' }),
  generateFieldModelFromRawData({ id: 'title', title: 'Title', type: 'text' }),
  generateFieldModelFromRawData({ id: 'description', title: 'Description', type: 'text', lines: 3 }),
  generateFieldModelFromRawData({ id: 'imagePlaceholderValue', title: '', type: 'text' }),
  new ReferenceField('members', 'Members', 'name', 'imageUrl', 'users', [
    new AttachmentField('imageUrl', ''),
    new TextField('firstName', 'First Name'),
    new TextField('lastName', 'Last Name'),
    new TextField('name', 'Name'),
  ], false),
];
function getQueryParamValueFromNestedFilter(filter) {
  if (!filter) {
    return {};
  }
  if (filter === null || filter === void 0 ? void 0 : filter.filters) {
    let nestedValues = {};
    filter.filters.forEach(f => {
      nestedValues = Object.assign(nestedValues, getQueryParamValueFromNestedFilter(f));
    });
    return nestedValues;
  }
  if (!filter.id) {
    return {};
  }
  return {
    [filter.id]: filter.value,
  };
}
function convertDevingenQueryToMemberListQuery(query) {
  // console.log(JSON.stringify(query.filter, null, 2));
  const { limit = 25, skip = 0 } = query;
  const mentornityMemberListQuery = {
    limit, skip,
  };
  const filterValuesFromUI = getQueryParamValueFromNestedFilter(query.filter);
  const fieldIds = Object.keys(filterValuesFromUI);
  fieldIds.forEach(fieldId => {
    if (['search', 'title', 'bio', 'skills'].includes(fieldId)) {
      mentornityMemberListQuery[fieldId] = filterValuesFromUI[fieldId];
    }
    else {
      mentornityMemberListQuery[`metadata.data.${fieldId}`] = filterValuesFromUI[fieldId];
    }
  });
  // console.log(mentornityMemberListQuery);
  return mentornityMemberListQuery;
}
function convertMentornityFieldToDevingenField(field) {
  let dvnField;
  if (field.type === 'ratingStars') {
    dvnField = new RangeField(field.id, field.title, field.description, 0.2, 0.2, 1).setInputType('stars');
  }
  else if (field.type === 'singleChoice') {
    dvnField = new SingleChoiceField(field.id, field.title, field.options, field.description, field.inputType, field.placeholder);
  }
  else if (field.type === 'multipleChoice') {
    dvnField = new MultipleChoiceField(field.id, field.title, field.options, field.description, field.inputType, field.placeholder);
  }
  else {
    dvnField = generateFieldModelFromRawData(field);
  }
  if (field.required) {
    dvnField.require();
  }
  return dvnField;
}
function convertDevingenRefToMentornityRef(ref) {
  return {
    _id: ref._id,
    _class: ref._ref,
    _type: 'reference'
  };
}
function convertDevingenEventToMentornityEvent(context, organisationConfig, event) {
  var _a, _b;
  const { organisationId, userId, role } = context;
  const currentUserAsGuest = event.guests.find(guest => guest._id === userId);
  const otherGuest = event.guests.find(guest => guest._id !== userId);
  if (organisationConfig.menteeType === 'group') {
    // convert the reference class to groups if the mentee type is group
    if (role === 'mentor') {
      // other user must be groups
      otherGuest._ref = 'groups';
    }
    else {
      // mentee is creating the meeting as the group
      currentUserAsGuest._ref = 'groups';
      currentUserAsGuest._id = context.groupId;
    }
  }
  // first user in the array must be mentor ref
  const guests = role === 'mentor' ? [currentUserAsGuest, otherGuest] : [otherGuest, currentUserAsGuest];
  return {
    location: (((_a = event.locations) === null || _a === void 0 ? void 0 : _a[0]) || {}),
    createdBy: convertDevingenRefToMentornityRef(event.createdBy),
    organisation: {
      _id: organisationId,
      _class: 'organisations',
      _type: 'reference'
    },
    availability: {
      _id: (_b = event.availability) === null || _b === void 0 ? void 0 : _b._id,
      _class: 'availabilities',
      _type: 'reference'
    },
    guests: guests.map(guest => ({
      _id: guest._id,
      _class: guest._ref === 'kimlik-users' ? 'users' : guest._ref,
      _type: 'reference'
    })),
    type: 'meeting',
    status: 'active',
    meetingGoalIdentifier: event.meetingType,
    startDate: new Date(event.startDate).getTime() / 1000,
    endDate: new Date(event.endDate).getTime() / 1000,
  };
}
function generateCalendarConfig(config) {
  const { meetingSettings } = config;
  const canMentorsCreateAvailability = !!meetingSettings.mentorsCanCreateAvailability;
  const canMenteesCreateMeeting = !!meetingSettings.menteesCanCreateMeeting;
  const canMentorsCreateMeeting = !!meetingSettings.mentorsCanCreateMeeting;
  return CalendarConfig.decode({
    _id: 'mentornity-calendar-config',
    membershipPreferences: [
      {
        membershipConfig: generateMembershipConfigForRole('mentor'),
        canCreateAvailableTime: canMentorsCreateAvailability,
        eligibleMembershipsForCustomTime: !canMenteesCreateMeeting ? [] : [
          generateMembershipConfigForRole('mentee'),
        ]
      },
      {
        membershipConfig: generateMembershipConfigForRole('mentee'),
        canCreateAvailableTime: false,
        eligibleMembershipsForCustomTime: !canMentorsCreateMeeting ? [] : [
          generateMembershipConfigForRole('mentor'),
        ]
      },
    ]
  });
}
class MentornityBridgeApi {
  constructor(endpoint, context, headers) {
    this.client = new APIBase(endpoint, headers);
    this.context = context;
  }
  addAuthInterceptor(_token) {
    // console.log('MBA.addAuthInterceptor', token);
  }
  // DATA API
  get(collection, id, _query) {
    // console.log('MBA.get', collection, id, _query);
    const { organisationId } = this.context;
    if (collection === 'groups') {
      return new Promise((resolve => {
        this.client.get(`groups/${id}`).then(response => {
          resolve(DataModel.decode(Object.assign(Object.assign({ 
            // dvn-app-view-atama-member-pair-detail-view expects 'user' field in the 'membership' object
            user: {
              // id is needed here because the user object is sent to web-client when create meeting is clicked
              _id: response._id,
              firstName: response.title,
              lastName: ' ',
            } }, response), { members: (response.members || []).map(member => (Object.assign(Object.assign({}, member), { name: `${member.firstName} ${member.lastName}` }))) })));
        }).catch(_e => {
          // console.log(e);
        });
      }));
    }
    return new Promise((resolve => {
      this.client.get(`organisations/${organisationId}/${collection}/${id}`).then(response => {
        var _a;
        // separate metadata and user data. consider title, bio and skills as metadata
        const { metadata, title, bio, skills } = response, rest = __rest(response, ["metadata", "title", "bio", "skills"]);
        resolve(DataModel.decode(Object.assign(Object.assign({ user: User.decode(rest) }, (((_a = response.metadata) === null || _a === void 0 ? void 0 : _a.data) || {})), { title, bio, skills })));
      }).catch(_e => {
        // console.log(e);
      });
    }));
  }
  query(collection, query) {
    if (['mentees', 'mentors'].includes(collection)) {
      // this request is called by dvn-app-view-detail-view-card that is opened
      // when mentor clicks on the mentee info inside the received requests list
      const { organisationId } = this.context;
      const menteeId = query.filter.value;
      return new Promise((resolve => {
        this.client.get(`organisations/${organisationId}/${collection}/${menteeId}`).then(response => {
          var _a;
          // separate metadata and user data. consider title, bio and skills as metadata
          const { metadata, title, bio, skills } = response, rest = __rest(response, ["metadata", "title", "bio", "skills"]);
          resolve({
            results: [
              DataModel.decode(Object.assign(Object.assign(Object.assign({ name: `${response.firstName} ${response.lastName}`, user: User.decode(rest) }, (((_a = response.metadata) === null || _a === void 0 ? void 0 : _a.data) || {})), { title, bio, skills }), rest))
            ]
          });
        }).catch(e => {
          console.log(e);
        });
      }));
    }
    else if (['mentee-card-list', 'mentor-card-list'].includes(collection)) {
      const queryParams = convertDevingenQueryToMemberListQuery(query);
      // this request is called by mentornity-user-card-list-wrapper that is shown
      // for the mentee and mentor list pages
      const { organisationId } = this.context;
      const collectionToQuery = collection === 'mentee-card-list' ? 'mentees' : 'mentors';
      return new Promise((resolve => {
        this.client.get(`organisations/${organisationId}/${collectionToQuery}`, Object.assign({ appendAvailabilities: true, appendSubscription: true, expandMetadatas: true }, queryParams)).then(response => {
          var _a;
          // separate metadata and user data. consider title, bio and skills as metadata
          resolve({
            meta: {
              total: ((_a = response.meta) === null || _a === void 0 ? void 0 : _a.total) || 0,
            },
            results: response.results.map((user) => {
              const { metadata, title, bio, skills, // membership data
              _id, email, firstName, lastName, imageUrl, // profile data
              availabilities, } = user;
              // auto generated values. used in cardViewConfig
              const name = `${user.firstName} ${user.lastName}`;
              const initials = `${user.firstName[0]}${user.lastName[0]}`;
              return Membership.decode(Object.assign(Object.assign({ 
                // user id is used as membership id too
                _id }, ((metadata === null || metadata === void 0 ? void 0 : metadata.data) || {})), { title, bio, skills, 
                // user data
                user: { _id, email, firstName, lastName, imageUrl, name, initials }, 
                // used by mentornity-schedule-meeting-button-on-card in mentor card list
                availabilities }));
            }).sort((a, b) => a.user.name.localeCompare(b.user.name))
          });
        }).catch(e => {
          console.log(e);
        });
      }));
    }
    return Promise.resolve(undefined);
  }
  update(_collection, _id, _body) {
    return Promise.reject({ status: 418 });
  }
  // ATAMA API
  getPairsOfUser(_base, _collection, userRefFieldId, _userRefFieldValue) {
    // console.log('MBA.getPairsOfUser', base, collection, userRefFieldId, userRefFieldValue);
    const { organisationId } = this.context;
    const { menteeType } = this.organisationConfig;
    // if user reference field is subscribed, then it's a mentor viewing its mentees
    const listToFetch = userRefFieldId === 'subscribed'
      ? (menteeType === 'group' ? 'groups' : 'mentees')
      : 'mentors';
    const itemNameToReturn = userRefFieldId === 'subscribed' ? 'subscriber' : 'subscribed';
    const params = listToFetch === 'groups'
      ? { expandCreatedBy: false }
      : { expandMetadatas: true, appendSubscription: true, };
    return new Promise((resolve => {
      this.client.get(`organisations/${organisationId}/${listToFetch}`, params).then(response => {
        // console.log('response', response);
        setTimeout(() => resolve({
          results: response.results
            // show only the active pairs
            .filter(item => { var _a; return ((_a = item.subscription) === null || _a === void 0 ? void 0 : _a.status) === 'active'; })
            .map(item => {
            var _a;
            return ({
              [itemNameToReturn]: [Object.assign(Object.assign(Object.assign({}, item), (((_a = item.metadata) === null || _a === void 0 ? void 0 : _a.data) || {})), { name: `${item.firstName} ${item.lastName}`, imagePlaceholderValue: listToFetch === 'groups'
                    ? ((item.title && item.title.length > 0) ? item.title[0] : '')
                    : `${item.firstName[0]} ${item.lastName[0]}` })],
              status: item.subscription.status,
            });
          }),
          meta: response.meta,
        }), 100);
      }).catch(_e => {
        // console.log(e);
      });
    }));
  }
  getSelectionList(_base, _collection, _pairConfigId, _userRefFieldId, _memberToViewRefFieldId) {
    // console.log('MBA.getSelectionList', base, collection, pairConfigId, userRefFieldId, memberToViewRefFieldId);
    const { organisationId } = this.context;
    return new Promise(resolve => {
      this.client.get(`organisations/${organisationId}/mentors/selection`).then(response => resolve({
        results: response.results.map(item => {
          var _a;
          return (Object.assign(Object.assign(Object.assign({}, item), (((_a = item.metadata) === null || _a === void 0 ? void 0 : _a.data) || {})), { name: `${item.firstName} ${item.lastName}` }));
        })
      })).catch(_e => {
        // console.log(e);
      });
    });
  }
  getSentRequests(_base, _collection, _userRefFieldValue) {
    // console.log('MBA.getSentRequests', base, collection, userRefFieldValue);
    const { organisationId } = this.context;
    return new Promise((resolve => {
      this.client.get(`organisations/${organisationId}/mentors`, { appendRequestSubscriptions: true, limit: 1000 }).then(response => {
        // console.log('response', response);
        setTimeout(() => resolve({
          results: response.results
            // subscription must contain 'requestedAt' field if this subscription is created via selection request
            .filter(item => { var _a; return !!((_a = item.subscription) === null || _a === void 0 ? void 0 : _a.requestedAt); })
            .map(item => ({
            sentTo: User.decode(item),
            status: getRequestStatus(item.subscription),
            requestedAt: item.subscription.requestedAt,
            acceptedAt: item.subscription.acceptedAt,
            rejectedAt: item.subscription.rejectedAt,
            canceledAt: item.subscription.canceledAt,
          })),
          meta: response.meta,
        }), 100);
      }).catch(_e => {
        // console.log(e);
      });
    }));
  }
  getReceivedRequests(_base, _collection) {
    // console.log('MBA.getReceivedRequests', base, collection);
    const { organisationId } = this.context;
    return new Promise((resolve => {
      this.client.get(`organisations/${organisationId}/mentees`, { expandMetadatas: true, limit: 1000 }).then(response => {
        setTimeout(() => resolve({
          results: response.results
            // subscription must contain 'requestedAt' field if this subscription is created via selection request
            .filter(item => { var _a; return !!((_a = item.subscription) === null || _a === void 0 ? void 0 : _a.requestedAt); })
            // show only pending requests
            .sort((a, b) => b.subscription.createdAt - a.subscription.createdAt)
            .map(item => ({
            _id: item.subscription._id,
            sentBy: User.decode(item),
            status: getRequestStatus(item.subscription),
            requestedAt: item.subscription.requestedAt,
            acceptedAt: item.subscription.acceptedAt,
            rejectedAt: item.subscription.rejectedAt,
            canceledAt: item.subscription.canceledAt,
          })),
          meta: response.meta,
        }), 100);
      }).catch(_e => {
        // console.log(e);
      });
    }));
  }
  sendPairRequest(_base, _collection, _userRefFieldId, userRefFieldValue, _memberToViewRefFieldId, memberToViewData) {
    // console.log('MBA.endPair', base, collection, pairId);
    const { organisationId } = this.context;
    const subscription = {
      mentorship: { _type: 'reference', _class: 'mentorships', _id: memberToViewData.mentorship._id },
      organisation: { _type: 'reference', _class: 'organisations', _id: organisationId },
      subscribed: { _type: 'reference', _class: 'users', _id: memberToViewData._id },
      subscriber: { _type: 'reference', _class: 'users', _id: userRefFieldValue },
      status: 'requested',
    };
    return this.client.post(`subscriptions`, subscription);
    // return Promise.reject({ status: 409 });
  }
  acceptPairRequest(_base, _collection, requestId) {
    return this.client.post(`subscriptions/${requestId}/accept`, {});
  }
  rejectPairRequest(_base, _collection, requestId) {
    return this.client.post(`subscriptions/${requestId}/reject`, {});
  }
  // getMeetingsOfUser(_base: string, _collection: string, _structureId: string, _userRefFieldValue: string): Promise<GetListResponse<DataModel>> {
  //   // console.log('MBA.getMeetingsOfUser', base, collection, structureId, userRefFieldValue);
  //
  //   // the response contains all the meetings with different users
  //   // here we filter the events based on the user id we're viewing
  //   const userIdToView = new URLSearchParams(window.location.search).get('uid');
  //
  //   return new Promise((async resolve => {
  //     const response = await this.client.get<any>(
  //       `organisations/${this.context.organisationDomain}/meetingsInMeetingGoal`,
  //     );
  //     resolve({
  //       results: response.results.filter(meeting => meeting.guests.some(guest => guest._id === userIdToView))
  //     });
  //   }));
  // }
  endPair(_base, _collection, pairId) {
    // console.log('MBA.endPair', base, collection, pairId);
    return new Promise((async (resolve) => {
      const response = await this.client.post(`subscriptions/${pairId}/complete`, {});
      resolve(response);
    }));
  }
  // UYE API
  getAppConfigOfMembership(_id) {
    // console.log('MBA.getAppConfigOfMembership', id);
    return Promise.reject({ status: 418 });
  }
  consentAgreement(_id) {
    // console.log('MBA.consentAgreement', id);
    return Promise.reject({ status: 418 });
  }
  getAgreement(_id) {
    // console.log('MBA.getAgreement', id);
    return Promise.reject({ status: 418 });
  }
  activateMembership(_membershipConfigId, _membershipId) {
    // console.log('MBA.getMembership', id);
    return Promise.reject({ status: 418 });
  }
  getMembership(_membershipConfigId, _membershipId) {
    // console.log('MBA.getMembership', id);
    return Promise.reject({ status: 418 });
  }
  getMembershipsOfUser(_userId) {
    // console.log('MBA.getMembershipsOfUser', userId);
    return Promise.reject({ status: 418 });
  }
  getMembershipConfig(id) {
    console.log('MBA.getMembershipConfig', id);
    return Promise.reject({ status: 418 });
  }
  getMembershipConfigWithName(name) {
    // console.log('MBA.getMembershipConfigWithName', name);
    const { organisationId } = this.context;
    return new Promise((async (resolve) => {
      this.client.get(`organisations/${organisationId}/config`).then(organisationConfig => {
        this.organisationConfig = organisationConfig;
        let fields = [];
        let roleName = '';
        if (name === 'mentees') {
          roleName = 'mentee';
          fields = [
            ...commonUserInfoFields,
            ...organisationConfig.metadatas.mentee
              .map(convertMentornityFieldToDevingenField),
          ];
        }
        else if (name === 'mentors') {
          roleName = 'mentor';
          fields = [
            ...commonUserInfoFields,
            ...organisationConfig.metadatas.mentor
              .map(convertMentornityFieldToDevingenField),
          ];
        }
        else if (name === 'groups') {
          roleName = 'mentee';
          fields = [
            ...groupInfoFields,
          ];
        }
        resolve(MembershipConfig.decode({
          _id: name,
          roleName,
          fields,
        }));
      }).catch(_e => {
        // console.log(e);
      });
    }));
  }
  updateMembership(_membershipConfigId, _membershipId, _data) {
    // console.log('MBA.updateMembership', id, data);
    return Promise.reject({ status: 418 });
  }
  getAvailabilities(_availabilityConfigId) {
    return Promise.reject({ status: 418 });
  }
  getAvailabilitiesOfUser(_calendarConfigId, userId) {
    const { organisationId, role } = this.context;
    if (role === 'mentor') {
      // mentor is viewing mentee's calendar. return empty availability list
      return Promise.resolve({ results: [] });
    }
    return new Promise((resolve => {
      this.client.get(`organisations/${organisationId}/mentors/${userId}/availabilities`).then(response => {
        resolve({
          results: response.results
            .map(item => (Object.assign(Object.assign({}, item), { breakDuration: item.meetingBreaks, location: item.location.address, locationType: item.location.type, startDate: new Date(item.startDate * 1000), endDate: new Date(item.endDate * 1000) }))),
        });
      }).catch(e => {
        console.log(e);
      });
    }));
  }
  getCalendarConfig(_id) {
    return Promise.resolve(generateCalendarConfig(this.organisationConfig));
  }
  getMeetingsOfUser(calendarConfigId, guestIDs) {
    if (calendarConfigId === 'mentornity-calendar-config') {
      return new Promise((async (resolve) => {
        const { groupId, organisationId, userId } = this.context;
        const isFetchingGroupMeetings = !!groupId;
        const idToUse = isFetchingGroupMeetings ? groupId : userId;
        const collectionToUse = isFetchingGroupMeetings ? 'groups' : 'users';
        const userIdToView = guestIDs.filter(id => id !== idToUse)[0];
        const response = await this.client.get(`${collectionToUse}/${idToUse}/events`, { organisationId: organisationId, limit: 1000 });
        resolve({
          results: response.results
            .filter(meeting => meeting.guests.some(guest => guest._id === userIdToView))
            .filter(meeting => meeting.status === 'active')
            .map(meeting => (Object.assign(Object.assign({}, meeting), { 
            // add 'name' field for users and groups for displaying their name on the meeting list
            guests: meeting.guests.map(guest => (Object.assign(Object.assign({}, guest), { name: guest.firstName ? `${guest.firstName} ${guest.lastName}` : guest.title }))), startDate: new Date(meeting.startDate * 1000), endDate: new Date(meeting.endDate * 1000) })))
        });
      }));
    }
    else if (calendarConfigId === 'mentornity-structured-calendar-config') {
      // getting meetings in a structured program
      // the response contains all the meetings with different users
      // here we filter the events based on the user id we're viewing
      const userIdToView = new URLSearchParams(window.location.search).get('uid');
      return new Promise((async (resolve) => {
        const response = await this.client.get(`organisations/${this.context.organisationDomain}/meetingsInMeetingGoal`, { limit: 1000 });
        resolve({
          results: response.results
            .filter(meeting => meeting.guests.some(guest => guest._id === userIdToView))
            .map(meeting => (Object.assign(Object.assign({}, meeting), { meetingType: meeting.meetingGoalIdentifier, startDate: new Date(meeting.startDate * 1000), endDate: new Date(meeting.endDate * 1000) })))
        });
      }));
    }
    return Promise.reject('unexpected-calendar-config');
  }
  getUnavailabilitiesOfUser(_calendarConfigId, userId, _startTime, _endTime) {
    const { role, userId: userIdInContext, groupId } = this.context;
    const isGroupedProgram = this.organisationConfig.menteeType === 'group';
    const isMentorGettingOwnData = role === 'mentor' && userId === userIdInContext;
    const isMentorGettingAnotherGuestData = role === 'mentor' && userId !== userIdInContext;
    const isMenteeGettingOwnData = role === 'mentee' && userId === userIdInContext;
    const isMenteeGettingAnotherGuestData = role === 'mentee' && userId !== userIdInContext;
    let roleToCheck = 'mentors';
    if (isMentorGettingOwnData || isMenteeGettingAnotherGuestData) {
      roleToCheck = 'mentors';
    }
    else if (isMenteeGettingOwnData || isMentorGettingAnotherGuestData) {
      roleToCheck = isGroupedProgram ? 'groups' : 'mentees';
    }
    let idToCheck = userId;
    if (isMenteeGettingOwnData && isGroupedProgram) {
      // mentee is getting its group unavailabilities
      idToCheck = groupId;
    }
    return new Promise((resolve => {
      this.client.get(`organisations/${this.context.organisationId}/${roleToCheck}/${idToCheck}/unavailabilities`).then(response => {
        resolve({
          results: response.results,
        });
      }).catch(e => {
        console.log(e);
      });
    }));
  }
  createMeeting(meeting) {
    const mentornityEvent = convertDevingenEventToMentornityEvent(this.context, this.organisationConfig, meeting);
    return new Promise(((resolve, reject) => {
      this.client.post('events', mentornityEvent).then(response => {
        resolve(response);
      }).catch(e => {
        reject(e);
      });
    }));
  }
}

export { MentornityBridgeApi as M, convertMentornityFieldToDevingenField as a, skillsEN as b, commonUserInfoFields as c, generateCalendarConfig as d, getEmbeddedTranslation as g, legacyProfileFields as l, skills as s };
